摘要: 直接上代码:// 触摸背景,关闭键盘- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject]; UIView *view = (UIView... 阅读全文
posted @ 2014-06-24 11:46 小小有 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 在Objective-C中,可以使用#import和@class来引用别的类型, 但是你知道两者有什么区别吗?@class叫做forward-class, 你经常会在头文件的定义中看到通过@class的引用,原因就是当你只用@class来引入一个类时, 编译器知道有这么一个类,也就是说它能识别Eng... 阅读全文
posted @ 2014-05-28 16:56 小小有 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 一:确认网络环境3G/WIFI1. 添加源文件和framework开发Web等网络应用程序的时候,需要确认网络环境,连接情况等信息。如果没有处理它们,是不会通过Apple的审查的。Apple 的 例程 Reachability 中介绍了取得/检测网络状态的方法。要在应用程序程序中使用Reachabi... 阅读全文
posted @ 2014-05-27 17:19 小小有 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 第一、UIButton的定义 UIButton*button=[[UIButton buttonWithType:(UIButtonType);能够定义的button类型有以下6种,typedef enum {UIButtonTypeCustom = 0, 自定义风格UIButtonTypeRoun... 阅读全文
posted @ 2014-05-27 17:16 小小有 阅读(284) 评论(0) 推荐(0) 编辑
摘要: oc中单例模式可以使用以下方法来实现+ (YourClass *)sharedInstance{ static dispatch_once_t once; static YourClass *sharedInstance = nil; dispatch_once(&once, ^ ... 阅读全文
posted @ 2014-05-26 17:02 小小有 阅读(255) 评论(0) 推荐(0) 编辑
摘要: //16进制颜色(html颜色值)字符串转为UIColor+(UIColor *) hexStringToColor: (NSString *) stringToConvert{ NSString *cString = [[stringToConvert stringByTrimmingCh... 阅读全文
posted @ 2014-05-23 13:42 小小有 阅读(383) 评论(0) 推荐(0) 编辑
摘要: $jsonp = $_GET['jsonpcallback'];$arr = array( 'id' => '1', 'name' => 'test');echo $jsonp, '([', json_encode($arr), '])'; //返回的数据中括号数组好像是必须的?> 阅读全文
posted @ 2014-05-04 17:07 小小有 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 不可变数组 ——NSArray常用的初始化一个数组: NSArray *array1 = [[NSArray alloc] init]; NSArray *array2 = [NSArray array]; //对于上述两个方法,在NSArray中用的很少,因为这是一个空数组,它的值是不可... 阅读全文
posted @ 2014-05-04 09:37 小小有 阅读(862) 评论(0) 推荐(0) 编辑
摘要: //1、创建常量字符串。NSString *astring = @"This is a String!";//2、创建空字符串,给予赋值。NSString *astring = [[NSString alloc] init]; astring = @"This is a String!"; [ast... 阅读全文
posted @ 2014-05-04 09:25 小小有 阅读(447) 评论(0) 推荐(0) 编辑
摘要: 1. 文件CMD + N: 新文件CMD + SHIFT + N: 新项目CMD + O: 打开CMD + S: 保存CMD + SHIFT + S: 另存为CMD + W: 关闭窗口CMD + SHIFT + W: 关闭文件2. 编辑CMD + [: 左缩进CMD + ]: 右缩进CMD + CT... 阅读全文
posted @ 2014-04-25 10:39 小小有 阅读(220) 评论(0) 推荐(0) 编辑