码迷,mamicode.com
首页 >  
搜索关键字:nsstring    ( 4622个结果
常见错误收集
1,iOS中AFN Get请求包含中文时崩溃NSString *search = @"http://60.206.137.156:8020/video_api/user/search/51234562346412e86a730d94fef7cc73/中";[manger GET: search pa...
分类:其他好文   时间:2014-09-28 21:34:15    阅读次数:145
OC中intValue要注意的地方
在程序中,发现一个问题,写了个例子,如下: NSDictionary * dict = [[NSDictionary alloc] init]; NSString * str = [dict objectForKey:@"key"]; NSLog(@"%d",[str intValue]);...
分类:其他好文   时间:2014-09-28 21:07:25    阅读次数:149
ios文件操作
IOS访问沙盒目录API获取程序目录 NSString *homePath = NSHomeDirectory();~/Library/Application Support/iPhone Simulator/7.1/Applications/66095245-FD69-40D5-B3F5-959....
分类:移动开发   时间:2014-09-28 17:52:43    阅读次数:191
判断字符串里是否有表情
刚遇到一个需求,发的字符里面不能有表情,下面是实现方法:/** * 判断文字里面是否包含表情 */- (BOOL)isContainsEmoji:(NSString *)string { __block BOOL isEomji = NO; [string enumerateSubstr...
分类:其他好文   时间:2014-09-27 19:09:30    阅读次数:218
OC:字典转模型
1 新建一个NSObject的类作为模型类:#import @interface VSQuestion : NSObject@property (nonatomic,copy)NSString *answer;@property (nonatomic,copy)NSString *icon;@pro...
分类:其他好文   时间:2014-09-27 11:58:39    阅读次数:215
iOS字符串NSString中去掉空格(或替换为某个字符串)
http://blog.sina.com.cn/s/blog_6f29e81f0101qwbk.html【问题描述】今天请求服务器返回的字段中含有空格,这空格是服务器开发人员不小心往数据中多敲了,所以在客户端需要把字符串中的空格过滤掉。【问题分析】1、使用NSString中的stringByTrim...
分类:移动开发   时间:2014-09-26 19:21:08    阅读次数:208
创建UIImage的两种方法
1.UIImage *img = [UIImage imageNamed:@"imageName"];2.NSString *imageFilePath = [[NSBundle mainBundle] pathForResource:@"100" ofType:@"jpg"];NSData *im...
分类:其他好文   时间:2014-09-26 19:03:08    阅读次数:155
iOS 在应用中播放本地视频文件
可以使用MPMoviePlayerController来播放本地视频文件 1.添加 Mediaplayer framework 并且在viewcontroller中#import   2. 把视频文件拖拽到xcode中 3. 获取文件存放的路径 NSString*thePath=[[NSBundle mainBundle] pathForResource:@"yourVideo" of...
分类:移动开发   时间:2014-09-25 22:41:38    阅读次数:440
ios开发之APP升级的实现
直接上代码:/** * 检测软件是否需要升级 */ -(void)checkVersion { NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/cn/lookup?id=%i",iFeverAPPID]]; ASIHTTPRequest *reques...
分类:移动开发   时间:2014-09-25 20:33:17    阅读次数:227
Xcode6获取app名字的方法和Xcode5的不同
1.在Xcode5下,获取程序名字(app name)的方法为:NSString *proName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];NSLog(@"dicName ==== ...
分类:移动开发   时间:2014-09-25 17:09:29    阅读次数:174
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!