1、创建block用copy修饰,拷贝到堆上 2、之前一直用这种写法,但会碰到提前释放的状态 __weak typeof(self)wakeself = self; 3、就用弱指针指向self,在block内部对weakSelf产生一个强引用,就解决了提前释放的问题 @weakify(self); ...
分类:
其他好文 时间:
2017-04-24 17:19:59
阅读次数:
134
class Foo: x=1 def __init__(self,y): self.y=y def __getattr__(self, item): print('----> from getattr:你找的属性不存在') def __setattr__(self, key, value): pri... ...
分类:
其他好文 时间:
2017-04-24 17:17:36
阅读次数:
155
Client端: class FtpClient: 'ftp客户端,但是还没有实现具体的功能' def __init__(self,addr): print('正在连接服务器[%s]'% addr) self.addr = addr Server端: from FtpClient import Ft ...
分类:
其他好文 时间:
2017-04-24 16:30:17
阅读次数:
236
class MyClass(object): def __init__(self): self._some_property = "properties are nice" self._some_other_property = "VERY nice" def normal_method(*args... ...
分类:
其他好文 时间:
2017-04-24 12:38:39
阅读次数:
269
特性的存在就是将方法伪装成字段。property把类方法当做普通字段去调用,即用对象调用的时候后面不用加括号#!/usr/bin/envpython#_*_coding:utf-8_*_classFoo:@propertydefCharacteristic(self):print("类方法的特性")#创建一个对象obj=Foo()#调用类方法的时候方法后面不用加括..
分类:
编程语言 时间:
2017-04-24 12:31:26
阅读次数:
182
最近在找PCIe/NVMe协议分析仪,发现一款软件分析仪:busTRACE,非常不错的工具,对于从事协议开发的同胞们,是个福利,下面把硬件和软件两种分析仪的各自的优势比较了一下(来自busTrace文档),供参考学习: Hardware Analyzer Advantages over busTRA ...
分类:
其他好文 时间:
2017-04-24 12:08:42
阅读次数:
277
2、火狐的profile文件记录信息实现 4、万能验证码、去掉验证码 2、隐形等待 3、显性等待 三、unittest单元测试框架 ...
分类:
编程语言 时间:
2017-04-24 01:02:24
阅读次数:
244
这里,我们考虑以下二种情况。 问题1。 如何调用父view的controller里面的方法? 答案如下:[[self superview ].nextResponder method];[[[self superview ] nextResponder] method];[self.nextResp ...
分类:
移动开发 时间:
2017-04-24 00:03:28
阅读次数:
263
self.navigationBar.setBackgroundImage(createImageWithColor(UIColor.clear),for:.default)//////////////////////funccreateImageWithColor(_color:UIColor)->UIImage{returncreateImageWithColor(color,size:CGSize(width:1,height:1))}funccreateImageWithColor(_color..
分类:
其他好文 时间:
2017-04-23 23:16:47
阅读次数:
436
//加入手势,点击屏幕其它区域关闭键盘操作 UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(SEL)]; gesture.numberOfTa ...
分类:
移动开发 时间:
2017-04-23 18:56:31
阅读次数:
343