2014年1月13日

iOS NSString的常用用法

摘要: 转自:http://www.cnblogs.com/lovekarri/articles/2380033.html温故知新,常用常新//1、创建常量字符串。NSString *astring = @"This is a String!";//2、创建空字符串,给予赋值。NSString *astring = [[NSString alloc] init]; astring = @"This is a String!"; [astring release]; NSLog(@"astring:%@",astring);//NSString 阅读全文

posted @ 2014-01-13 17:23 王培 阅读(248) 评论(0) 推荐(0) 编辑

NSCharacterSet 去除NSString中的空格

摘要: 转自:http://blog.sina.com.cn/s/blog_5421851501014xif.html去除username中的空格,table newline,nextline代码如下:(三行代码)NSCharacterSet *whitespace = [NSCharacterSetwhitespaceAndNewlineCharacterSet];NSString *username= [mUsernameField stringValue];username = [usernamestringByTrimmingCharactersInSet:whitespace];注释:str 阅读全文

posted @ 2014-01-13 17:16 王培 阅读(207) 评论(0) 推荐(0) 编辑

Xcode 警告信息处理:Format string is not a string literal (potentially insecure)

摘要: 转自:http://www.oschina.net/question/54100_33881NSObject *obj = @"A string or other object.";NSLog([NSString stringWithFormat:@"%@",obj]);// 有警告NSLog([NSString stringWithFormat:@"%@",obj],nil);// 解决方案 阅读全文

posted @ 2014-01-13 16:41 王培 阅读(509) 评论(0) 推荐(0) 编辑

导航