在iOS开发线程操作时,一般方法名决定是否开启新线程(async,sync),队列类型(全局队列,串行队列)决定开启多少条线程 1.快速线程调用 *开启后台线程执行任务 [self performSelectorInBackground:@selector(test) withObject:nil] ...
分类:
移动开发 时间:
2016-04-09 13:41:20
阅读次数:
258
微博中我学会的东西: 1.项目环境的搭建(推送,版本号,支持的iOS几版本几以上的,用与不用StoryBoard两种建立方式,APPIcon,启动图片的两种方式,还有项目类的前缀) 1.1 创建窗口: //创建窗口 //不能使用局部变量(UIWindow *window) self.window = ...
分类:
其他好文 时间:
2016-04-09 10:45:42
阅读次数:
252
读取和写入 文件 //传递文件路径方法 -(id)initPath:(NSString *)srcPath targetPath:(NSString *)targetPath { self = [super init]; if (self != nil) { _srcPath = [srcPath ...
分类:
其他好文 时间:
2016-04-09 10:44:23
阅读次数:
183
KVO(键值观察者) //监听的创建 -(id)initChildren:(Person *)person { self = [super init]; if (self != nil) { //拥有所有权,防止被自动释放 // _person = [person retain]; self.per ...
分类:
其他好文 时间:
2016-04-09 10:38:26
阅读次数:
108
表示图中Cell默认是不透明的,那么在设置表示图的背景颜色和图片时通常是看不到的 1.给tableView设置背景view UIImageView *backImageView=[[UIImageViewalloc]initWithFrame:self.view.bounds]; [backImag ...
分类:
其他好文 时间:
2016-04-09 10:26:45
阅读次数:
118
首先我们介绍一种最好用也最普遍的方法:触摸屏幕回收键盘,方法很简单,就是当触摸屏幕结束之后结束编辑就行,代码如下: - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { [self.view end ...
分类:
其他好文 时间:
2016-04-09 09:14:24
阅读次数:
187
在function ajax(options) {中 的url = (typeof url 'function') ? url.call(self, query.term, query.page, query.context) : url; 后加入 调用代码: ...
分类:
Web程序 时间:
2016-04-08 21:34:38
阅读次数:
316
self是一个指针,self指向的是调用当前方法的对象; 如果不理解,可以理解为当前对象; self可以访问当前对象的成员变量; self的第二个使用情况; - (void)bark { NSLog(@"汪汪汪"); } - (void)run { [self bark]; NSLog(@"跑跑跑" ...
分类:
其他好文 时间:
2016-04-08 19:46:51
阅读次数:
109
class myexception(Exception): def __init__(self,value): self.value = value self.message ='myexception error'def say(): #name='FreeMan' try: raise myex ...
分类:
编程语言 时间:
2016-04-08 14:38:01
阅读次数:
150
self-taught learning 在特征提取方面完全是用的无监督的方法,对于有标记的数据,可以结合有监督学习来对上述方法得到的参数进行微调,从而得到一个更加准确的参数a。 在self-taught learning中,首先用 无标记数据训练一个sparse autoencoder,这样用对于 ...
分类:
Web程序 时间:
2016-04-08 11:42:44
阅读次数:
224