您的位置:首页 > 移动开发 > IOS开发

iOS开发经验1.0

2016-05-21 14:23 465 查看
1.在故事版中设置分割线的方法

其实就是拖一个View进来然后加heigh=1的约束啦~

2.cocoapod install 速度慢的问题

pod install --verbose --no-repo-update


3.
#import "HHAlertView.h"


这是一个iOS提示对话框库,具体用法之后会提到

4.

[NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(XXXX:)
userInfo:nil
repeats:YES];


这是一个按照时间执行方法的方法函数,在等待60秒内验证码发送的startCount使用到了。

使用 NSTimer scheduledTimerWithTimeInterval: target: selector:userInfo: repeats: 的时候有两个地方需要注意 。

首先selector指定的方法必须是带一个参数的方法,并且那个参数的类型是NSTimer *。举个栗子

[NSTimer scheduledTimerWithTimeInterval:0.5
target:self
selector:@selector(sendBroadcast:)
userInfo:@"hello I'm the info to send"
repeats:NO];


sendBroadcast的定义形式应该是如下

其次,参数是靠NSTimer 对象的userInfo属性来传递的。

-(void)sendBroadcast: (NSTimer *)timer {
NSString *msg = (NSString *)[timer userInfo]; // [msg isEqualToString @"hello I'm the info to send"] == YES
}


以上是网上找的解释,之后发现具体实现根本不是一回事,并且最终效果不尽如人意(每次都有闪动),所以采用了第三方MZTimerlabel。

5.

UIAlterViewController

提醒框

http://www.jianshu.com/p/274123a17324

PS:这是第一次尝试写博客,希望能记录平时iOS开发遇到的问题和解决方案,同时也写一些日常生活的点滴。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: