javascript - Objective C cuts off last part of string -
We are working on a plug-in for Cordova and we want to build callback JavaScript so that the code from the original code Go.
So far, the problem here is:
NSString * js = [NSString stringWithFormat: @ "project.notificationCallback ('% @',% @);" Uuidstring, value]; This should create the following example:
"project.notificationClallback ('uuid-uuid-uuid-uuid-uuid', 1);" Instead of returning just the desired result, it gives:
"project.notificationClallback ('uuid-uuid-uuid-uuid-uuid', 1 " So it only cuts the last part of the string when we do this:
NSString * js = [NSString stringWithFormat: @ "Alarm ('jmoder')"]; All this works well, so we believe that with the exception of something else with % @ Is not there. Is there a obj-c expert in this house, which would avoid these characters I know or string is just a few letters too long?
If I work with a single string I get: project.notificationClallback ('uuid-uuid-uuid-uuid-uuid', 1);
Are you sure that NSString * js already has unexpected results? In your code Some may later restrict the length of the string.
For the maximum length of the NSString question, if you posted "NSstring max L ength" this site In the search box at the upper right, you will already have a reply (long ago results). Apart from this, I would recommend discussing someone's mother in my code samples.
Comments
Post a Comment