int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSMutableString *str1; [str1 setString:@"again"]; NSLog(@"string is -- %@",str1); // It prints " string is -- (null) " [str1 release]; [pool drain]; return 0; }
int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSMutableString *str1; str1 = [NSMutableString stringWithString:@"hello again "]; // By adding this [str1 setString:@"again"]; // Now this statements works properly . NSLog(@"string is -- %@",str1); [str1 release]; [pool drain]; return 0; }
setString
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)