码迷,mamicode.com
首页 >  
搜索关键字:nsstring    ( 4622个结果
数据持久化,简单对象写入本地,复杂对象写入本地
#import"MainViewController.h" #import"Student.h" @interfaceMainViewController() @end @implementationMainViewController -(id)initWithNibName:(NSString*)nibNameOrNilbundle:(NSBundle*)nibBundleOrNil { self=[superinitWithNibName:nibNameOrNilbundle:nibBundleOrN..
分类:其他好文   时间:2014-09-16 02:50:00    阅读次数:181
同步GET
创建get请求,1.将网址初始化成一个OC字符串对象.NSString*urlString=[NSStringstringWithFormat:@"%@?query=%@&region=%@&output=json&ak=6E823f587c95f0148c19993539b99295",kBusinessInfoURL,@"银行",@"济南"];如果网址中存在中文,进行转码NSString*urlString=@"..
分类:其他好文   时间:2014-09-15 19:56:09    阅读次数:126
异步GEI (2) 线程
将网址初始化成一个OC字符串对象.NSString*urlString=@"http://p_w_picpath.zcool.com.cn/56/13/1308200901454.jpg";NSString*newUrlString=[urlStringstringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];构建网络URL对象NSURL*URL=[NSURLURLWithString:newUrlS..
分类:编程语言   时间:2014-09-15 19:55:40    阅读次数:211
XML解析 DOM(2)
获取解析文件路径NSString*xmlPath=[[NSBundlemainBundle]pathForResource:@"Person"ofType:@"xml"];2.初始化xml字符串NSString*xmlStr=[NSStringstringWithContentsOfFile:xmlPathencoding:NSUTF8StringEncodingerror:nil];3.初始化一个GDataXMLDocument对象,因为解析时所有的..
分类:其他好文   时间:2014-09-15 11:30:29    阅读次数:149
读取文件 (字符串 / 数组 / 字典)
获取文件路径-(NSString*)getFilePath{2.获取所要存储的文件路径(1)获取Documents文件夹路径NSDocumentDirectory用来获取指定文件夹的路径NSUserDomainMask设置查找的域,我们的自己的文件都是存储在用户域的@paramyes是否使用详细路径(绝对路径)@return因为最初该方法是适用于M..
分类:其他好文   时间:2014-09-15 11:30:09    阅读次数:180
iOS 单例传值
写一个类  起作用是 传值 #import @interface singleton : NSObject +(singleton *)shareData;                      @property (strong, nonatomic) NSString *value; @end #import "singleton.h"...
分类:移动开发   时间:2014-09-15 11:21:28    阅读次数:164
iOS - 正则表达式判断邮箱、身份证..是否正确:
//邮箱+ (BOOL) validateEmail:(NSString *)email{ NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; NSPredicate *emailTest...
分类:移动开发   时间:2014-09-15 09:57:38    阅读次数:217
iOS 编程学习笔记之Foundation框架
Foundation 框架:NSString (c字符串前面加@)NSString*myString=@"My String\n";NSString*anotherString=[NSStringstringWithFormat:@"%d %@",1,@"String"];NSString*from...
分类:移动开发   时间:2014-09-15 09:54:48    阅读次数:189
同步POST请求
创建POST请求1根据网址初始化OC字符串对象NSString*urlString=[NSStringstringWithFormat:@"%@",kVideoURL];2创建URL对象NSURL*url=[NSURLURLWithString:urlString];3创建请求NSMutableURLRequest*requrst=[NSMutableURLRequestrequestWithURL:url];4创建参数字符串对象NSStrin..
分类:其他好文   时间:2014-09-15 03:29:28    阅读次数:236
XML解析 SAX
先获取解析的文件路径NSString*xmlPath=[[NSBundlemainBundle]pathForResource:@"Person"ofType:@"xml"];2.根据文件路径初始化一个NSData对象NSData*data=[NSDatadataWithContentsOfFile:xmlPath];3.创建解析工具对象NSXMLParser*xmlParser=[[NSXMLParseralloc]initWithData:da..
分类:其他好文   时间:2014-09-15 03:27:58    阅读次数:131
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!