Hi i am new to iphone development,can any one help how to append string to mutable string. im trying to string By appending String Format .application Is crashes...
Sample code NSMutableString:
NSMutableString* mutString = [[NSMutableString alloc] init];
for(int index=0;index<10;index++)
{
[mutString appendString:[NSString stringWithFormat:@"%d",index]];
}
NSLog(@"Content in MutableString: %@",mutString);
Regarding crash: post your code that crashes. What does it say ?
There is a crash when you try to append nil to a NSMutableString
- check that.
Also while it does not crash during append - if your NSMutablestring
is not initialized - then nothing works and your app might crash later in the code because there is nothing in your string.
Post the crash report, I am sure it will tell you what is going wrong.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With