使用字符串

Posted on 2013年3月12日 15:06

NSString和NSMutableString初始化值方式

NSString *simpleString = @"This is a simple string";
NSString *anotherString = [NSString stringWithString:@"This is another simple string"];
NSString *oneMorestring = [[NSString alloc] initWithString:@"One more!"];
NSMutableString *mutableOne = [NSMutableString stringWithString:@"Mutable String"];
NSMutableString *anotherMutableOne = [[NSMutableString alloc] initWithString:@"A retained one"];
NSMutableString *thirdMutableOne =[NSMutableString stringWithString:simpleString];