04 2016 档案

摘要:#import <UIKit/UIKit.h> #import "AppDelegate.h" main 函数为程序入口 int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, arg 阅读全文
posted @ 2016-04-28 22:19 谢小锋 阅读(150) 评论(0) 推荐(0)
摘要:iOS7之后如果想让UIApplication 管理状态栏需要在info.plist 中设置View controller-based status bar appearance 为NO iOS7 之后状态栏是由控制器设置的 控制器中添加这个可以隐藏 -(BOOL)prefersStatusBarH 阅读全文
posted @ 2016-04-28 17:34 谢小锋 阅读(166) 评论(0) 推荐(0)
摘要:dispatch_queue_t queue=dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); NSString * from=@""; NSString * to =@""; NSFileManager * magr=[N 阅读全文
posted @ 2016-04-25 14:38 谢小锋 阅读(390) 评论(0) 推荐(0)
摘要:// [self performSelector:@selector(play:) withObject:self afterDelay:3]; // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0*NSEC_PER_SEC 阅读全文
posted @ 2016-04-25 11:49 谢小锋 阅读(129) 评论(0) 推荐(0)
摘要:- (IBAction)action:(id)sender { NSLog(@"begin%@",[NSDate date]); NSDate * begin =[NSDate date]; NSData * dat =[NSData dataWithContentsOfURL:[NSURL URL 阅读全文
posted @ 2016-04-24 20:50 谢小锋 阅读(141) 评论(0) 推荐(0)
摘要:- (IBAction)action:(id)sender { count=100; self.thread1=[[NSThread alloc]initWithTarget:self selector:@selector(buy) object:@""]; self.thread2=[[NSThr 阅读全文
posted @ 2016-04-24 20:17 谢小锋 阅读(132) 评论(0) 推荐(0)
摘要:// // ViewController.m // 多线程 // // Created by 谢泽锋 on 16/4/24. // Copyright © 2016年 xiezefeng. All rights reserved. // #import "ViewController.h" #imp 阅读全文
posted @ 2016-04-24 16:43 谢小锋 阅读(100) 评论(0) 推荐(0)
摘要:#import <pthread.h> @interface ViewController () @end @implementation ViewController void * run(void *param){ for (int i=0; i<50000; i++) { NSLog(@"ru 阅读全文
posted @ 2016-04-24 16:05 谢小锋 阅读(127) 评论(0) 推荐(0)
摘要:@autoreleasepool { stu * s=[[[stu allow]init] autorelease];//可以不用release 自动释放会自动销毁 stu * s=[[[stu allow]init] autorelease]autorelease];错误不可以写两次 野指针错误 阅读全文
posted @ 2016-04-24 16:04 谢小锋 阅读(89) 评论(0) 推荐(0)
摘要:现成框架 sencha-touch phoneGap jQuery mobile bootstrap 阅读全文
posted @ 2016-04-24 15:44 谢小锋 阅读(117) 评论(0) 推荐(0)
摘要:ARC的判断准则:只要没有强指针指向对象,就会释放对象 指针分2种 1强指针:默认情况下,所有的指针都是强指针 __strong 2弱指针:__weak __weak Person* p=[Person new]错误写法 用弱指针对象会被释放 属于 编译特性 strong :强指针相当于原来reta 阅读全文
posted @ 2016-04-23 23:12 谢小锋 阅读(153) 评论(0) 推荐(0)
摘要:一方面解决循环引用问题 一方面解决性能问题 2循环应用 、 阅读全文
posted @ 2016-04-22 22:20 谢小锋 阅读(129) 评论(0) 推荐(0)
摘要:在Xcode6之前,创建一个新工程xcode会在Supporting files文件夹下面自动创建一个“工程名-Prefix.pch”文件,也是一个头文件,pch头文件的内容能被项目中的其他所有源文件共享和访问。是一个预编译文件。 首先说一下pch的作用: 1.存放一些全局的宏(整个项目中都用得上的 阅读全文
posted @ 2016-04-18 16:15 谢小锋 阅读(7261) 评论(0) 推荐(0)
摘要:1.runtime是一套底层的C语言API (很多包含强大的实用的C语言数据类型。C语言函数) 2.实际上,平时编写的OC代码,底层都是基于runtime实现的 也就是说,最终是转成底层runtime代码 unsigned int count=0; Ivar * ivars= class_copyI 阅读全文
posted @ 2016-04-18 16:13 谢小锋 阅读(198) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-04-15 11:43 谢小锋 阅读(108) 评论(0) 推荐(0)
摘要:访问坏的内存,被回收已经不可以用的内存,野指针 OC 中不存在空指针错误,发送消息,不报错 阅读全文
posted @ 2016-04-09 23:12 谢小锋 阅读(129) 评论(0) 推荐(0)
摘要://// ViewController.m// touchID//// Created by 谢泽锋 on 16/4/1.// Copyright © 2016年 xiezefeng. All rights reserved.//#import "ViewController.h"#import < 阅读全文
posted @ 2016-04-01 11:16 谢小锋 阅读(201) 评论(0) 推荐(0)