上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页
摘要: 1、先导入#import 框架,并在工程中导入该框架2、- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { self.imageView.image = [UIImage imageNamed:[NSString... 阅读全文
posted @ 2014-12-16 12:24 在bug中前行 阅读(154) 评论(0) 推荐(0)
摘要: 1、点击发送验证码,开始计时-(void)startTime{ __block int timeout=120; //倒计时时间 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_... 阅读全文
posted @ 2014-12-12 17:47 在bug中前行 阅读(173) 评论(0) 推荐(0)
摘要: 1、首先需要在控制器的view中添加上一个scrollView,并遵循UITextFieldDelegate代理,并设置文本框的自身代理2、添加手势监听 UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWit... 阅读全文
posted @ 2014-12-12 17:42 在bug中前行 阅读(237) 评论(0) 推荐(0)
摘要: //初始化textfield并设置位置及大小 UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)];//设置边框样式,只有设置了才会显示边框样式 text.borderStyle = U... 阅读全文
posted @ 2014-12-12 16:07 在bug中前行 阅读(229) 评论(0) 推荐(0)
摘要: 1.获取文件管理器 NSFileManager * fileManager = [NSFileManager defaultManager]; NSString * path = @"/Users/aplle/Desktop/test.txt"; NSError * error; ... 阅读全文
posted @ 2014-12-06 15:46 在bug中前行 阅读(142) 评论(0) 推荐(0)
摘要: 1.使用for循环遍历数组 NSArray * array = @[@"one",@"two",@"three"]; for (int i = 0; i < array.count; i++) { NSString * str = ar... 阅读全文
posted @ 2014-12-06 15:24 在bug中前行 阅读(165) 评论(0) 推荐(0)
摘要: 1、字符串的末尾追加字符串 NSString * str1 = @"www."; NSString * str2 = [str1 stringByAppendingString:@"baidu.cn"];2、字符串指定范围追加字符 NSString * str3 = @"www.cn... 阅读全文
posted @ 2014-12-06 14:18 在bug中前行 阅读(133) 评论(0) 推荐(0)
摘要: 1.效率肯定是delegate比nsnotification高。2. delegate方法比notification更加直接,最典型的特征是,delegate方法往往需要关注返回值, 也就是delegate方法的结果。比如-windowShouldClose:,需要关心返回的是yes还是no。所以d... 阅读全文
posted @ 2014-12-01 17:48 在bug中前行 阅读(316) 评论(0) 推荐(0)
摘要: 1. 同步发送- (NSString *)sendRequestSync{// 初始化请求, 这里是变长的, 方便扩展NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];// 设置[request setURL:[NSU... 阅读全文
posted @ 2014-11-27 17:52 在bug中前行 阅读(171) 评论(0) 推荐(0)
摘要: 1、同步请求可以从因特网请求数据,一旦发送同步请求,程序将停止用户交互,直至服务器返回数据完成,才可以进行下一步操作,2、异步请求不会阻塞主线程,而会建立一个新的线程来操作,用户发出异步请求后,依然可以对UI进行操作,程序可以继续运行3、GET请求,将参数直接写在访问路径上。操作简单,不过容易被外界... 阅读全文
posted @ 2014-11-27 14:11 在bug中前行 阅读(109) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页