随笔分类 -  iOS

上一页 1 ··· 3 4 5 6 7
摘要:#import @interface myClass1 : NSObject @property (nonatomic, copy) NSString *str; @end @implementation myClass1 @end @interface myClass : NSObject { } @property (nonatomic, retain) myClass1 *... 阅读全文
posted @ 2016-01-16 14:06 Ficow 阅读(257) 评论(0) 推荐(0)
摘要:TCP: 服务器: 客户端: UDP: 服务器: 客户端: 阅读全文
posted @ 2016-01-09 21:42 Ficow 阅读(721) 评论(0) 推荐(0)
摘要:1.记得在项目中设置项目文件命名的prefix,避免命名冲突。 2.在适当的位置对属性和方法进行注释,建议利用插件(如VVDocument)提供效率。在给企业看文档时,可以利用(如Doxygen)这种软件生成一个document。 3.操作CoreData需要谨慎,小小改动都有可能让程序崩溃。 4. 阅读全文
posted @ 2015-12-21 09:58 Ficow 阅读(194) 评论(0) 推荐(0)
摘要:The id type simply says a method will return a reference to an object. It could be any object of any type.The instancetype type says a method will ret 阅读全文
posted @ 2015-12-15 10:15 Ficow 阅读(156) 评论(0) 推荐(0)
摘要:Scale:拉伸图片,图片变形。 Aspect:图片长宽的保持比例,图片不变形。 Aspect Fill(常用):图像充满容器。以长宽中小的参数为限制。 Aspect Fit:图像在容器中完整显示。以长宽中大的参数为限制。 Scale To Fill: 缩放图片,使图片充满容器。图片未必保持长宽比例 阅读全文
posted @ 2015-12-14 09:54 Ficow 阅读(1161) 评论(0) 推荐(0)
摘要:image.userInteractionEnabled = YES; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imagePressed:)]; [image addGestureRecognizer:tap]; 阅读全文
posted @ 2015-12-14 09:45 Ficow 阅读(300) 评论(0) 推荐(0)
摘要:安装cocoapods的流程: 1.打开终端,输入: sudo gem update —system 2.输入密码,稍等 3.gem sources --remove https://rubygems.org/ ,最后的那个斜杠不能省略!!成功后显示 ...removed from sources。 阅读全文
posted @ 2015-12-13 10:40 Ficow 阅读(390) 评论(0) 推荐(0)
摘要:NSString *path = [[@"~" stringByExpandingTildeInPath] stringByAppendingString: @"/tmp.txt"]; [path writeToFile:path atomically:YES encoding:NSUTF8StringEncoding error:nil]; 阅读全文
posted @ 2015-12-12 10:02 Ficow 阅读(402) 评论(0) 推荐(0)
摘要:源码来自《Objective-C基础教程》 阅读全文
posted @ 2015-12-12 09:35 Ficow 阅读(991) 评论(0) 推荐(0)
摘要:NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSString *dateTime = [formatter stringFromDate:[NSDate date]]; NSLog(@"formatted time i... 阅读全文
posted @ 2015-12-12 09:31 Ficow 阅读(570) 评论(0) 推荐(0)
摘要:创建Empty文件,最好与其Controller同名, 在File's Owner的类属性里面指明其所属类(或者说它是个什么Controller), 从File's Owner右键拖向内部创建的视图(如UIView),选择view进行关联。 在Controller 的initWithNibName方 阅读全文
posted @ 2015-12-11 17:40 Ficow 阅读(331) 评论(0) 推荐(0)
摘要:1.不可变词典NSDictionary 字典初始化 NSNumber *numObj = [NSNumber numberWithInt:100]; 以一个元素初始化 NSDictionary *dic = [NSDictionary dictionaryWithObject:numObj forKey:@"key"]; 初始化两个元素 NSDictionary *dic =... 阅读全文
posted @ 2015-12-11 14:21 Ficow 阅读(959) 评论(0) 推荐(0)
摘要:非ARC模式下: ARC模式下: 阅读全文
posted @ 2015-12-10 10:03 Ficow 阅读(682) 评论(0) 推荐(0)
摘要:1、 同步GET请求 //第一步,创建URL NSURL *url = [NSURL URLWithString:@"http://api.hudong.com/iphonexml.do?type=focus-c"]; //第二步,通过URL创建网络请求 NSURLRequest *request = [[NSURLRequ... 阅读全文
posted @ 2015-12-10 09:38 Ficow 阅读(2625) 评论(0) 推荐(0)
摘要:新手写来自己用做备忘录的,可能存在很多错误,不喜勿喷。如有高手愿意指点一下,在下感激不尽! 阅读全文
posted @ 2015-12-10 00:02 Ficow 阅读(250) 评论(0) 推荐(0)
摘要:You can easily add it to the plist using the GUI: On the last line add the + Enter the name of the group: App Transport Security Right click on the gr 阅读全文
posted @ 2015-12-07 13:13 Ficow 阅读(216) 评论(0) 推荐(0)
摘要:注意事项: 1.一个.xib里面最多设置一个cell 2.要仔细调整自动布局,其实它不太好用 3.记得设置<UITableViewDataSource>委托 4.记得在ViewController中为TableView设置IBOutlet 5.从controller图标拖线到tablview上,关联 阅读全文
posted @ 2015-11-24 23:30 Ficow 阅读(243) 评论(0) 推荐(0)
摘要:关于cocoapods的安装和使用的基本教程: http://my.oschina.net/vimfung/blog/182427?fromerr=j7l3DvCG 出现以下错误提示: Specs satisfying the `IQKeyboardManager (~> 3.3.4)` depen 阅读全文
posted @ 2015-11-23 00:10 Ficow 阅读(5680) 评论(0) 推荐(0)
摘要:可以学习一下使用ReactiveCocoa库来做LoginDemo,很好用哦! 阅读全文
posted @ 2015-11-20 17:28 Ficow 阅读(450) 评论(0) 推荐(1)
摘要:一、隐藏自身软键盘 当对于有多个UITextField控件都想通过点击“Return”来隐藏自身软键盘的情况,这时的最好办法是使用Did End on Exit事件。在点击软键盘右下角的“Return”按钮后,会触发该事件。 该事件有一个sender参数表示当前文本框,这样便可以编写一个通用的事件处 阅读全文
posted @ 2015-11-18 23:31 Ficow 阅读(4832) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7