How to append a string to NSMutableString

前端 未结 5 1753
自闭症患者
自闭症患者 2021-01-01 14:50

i\'m an absolute newbie with objective-c

with this code

NSMutableString *teststring;
[teststring appendString:@\"hey\"];
NSLog(teststring);
         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-01 15:07

    Change first line to

    NSMutableString *teststring = [NSMutableString string];
    

提交回复
热议问题