摘要: NSString * str=[[NSStringalloc]init]; str=@"1234567890"; NSRange r; r=[str rangeOfString:textview.text]; if (r.location!=NSNotFound) { NSLog(@"found at location = %d,length = %d",r.location,r.length); } else { NSLog(@"not found"); } 阅读全文
posted @ 2012-02-27 16:42 凡娃软件 阅读(307) 评论(0) 推荐(0) 编辑
摘要: //获取文件路径 NSString *path = [[NSBundlemainBundle] pathForResource:@"user.plist"ofType:@""]; //获取数据 NSMutableDictionary* dict = [ [ NSMutableDictionaryalloc ] initWithContentsOfFile:path ]; NSString* object = [ dict objectForKey:@"aaa" ]; NSLog(object); //修改数据 NSMutableDic 阅读全文
posted @ 2012-02-27 14:56 凡娃软件 阅读(254) 评论(0) 推荐(0) 编辑
摘要: //判断文件是否存在 if(![c judgeFileExist:@"user.plist"]) { NSLog(@"请确认该文件是否存在!"); return; }//判断文件是否存在-(BOOL)judgeFileExist:(NSString * )fileName{ //获取文件路径 NSString *path = [[NSBundle mainBundle] pathForResource:fileName ofType:@""]; if(path==NULL) return NO; returnYES;} 阅读全文
posted @ 2012-02-27 14:55 凡娃软件 阅读(630) 评论(0) 推荐(0) 编辑