How to add a string String To Mutable

Hi, I am new to iphone development, can anyone help how to add string to mutable string. im trying to execute string When adding String Format. Application fails ...

+4
source share
2 answers

NSMutableString sample code:

NSMutableString* mutString = [[NSMutableString alloc] init]; for(int index=0;index<10;index++) { [mutString appendString:[NSString stringWithFormat:@"%d",index]]; } NSLog(@"Content in MutableString: %@",mutString); 

As for the failure: send your code that will fail. What he says?

+5
source

There was a failure while trying to add nil to NSMutableString - check this. Also, while it doesn't crash while adding - if your NSMutableString not initialized - then nothing works and your application may crash later in the code because there is nothing in your line. Post a crash report, I'm sure it will tell you what is going wrong.

+1
source

All Articles