开发者

Read in string from user and convert to NSString

How can i store user input as a nsstring to be placed within an nsmutablearray? scanf is not working for string type.

-(NSString *) addMemo;
{
NSMutableArray  *memoArray = [NSMutableArray ar开发者_如何学运维ray];
NSLog(@"Please add your memo.");
scanf("\n", &memo);
[memoArray addObject:memo];
}


You should be able to use NSString's stringWithCString:encoding: constructor to create an NSString from memo.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜