以前从未接触过block函数。如果在.h头文件中定义的形式如下的话:@property (nonatomic, copy) void(^fontValueChangedBlock)(void);则应该如此使用block函数_fontValueChangedBlock = ^(){ [self....
分类:
其他好文 时间:
2014-10-13 17:38:19
阅读次数:
167
以形如 _fontValueChangedBlock = ^(){ [self.fontSmallButton addTarget:self action:@selector(btnFontSmallClicked) forControlEvents:UIContr...
分类:
其他好文 时间:
2014-10-13 16:12:29
阅读次数:
170
2. static 关键字,这里作为作用域引用。类似于parent, self等关键字。与parent和self不同的是,parent 引用的是父类作用域,self引用的是当前类的作用域,而static引用的是全部静态作用域,子类会覆盖父类,考虑...
分类:
Web程序 时间:
2014-10-13 14:10:29
阅读次数:
171
event系统的核心至少满足:
1.存放事件的容器,可对事件添加删除
2.事件的触发fire
上代码.
class Event(list):
def __call__(self, *args, **kwargs):
for f in self:
f(*args, **kwargs)
def f(arg): print 'execute...
分类:
编程语言 时间:
2014-10-13 12:44:10
阅读次数:
168
用过linux的基本知道它的管道,是将一个程序或命令的输出作为另一个程序或命令的输入.
废话少说,下面我们看用python怎么实现unix管道风格的函数调用.
#coding=utf-8
class Pipe:
def __init__(self, func):
self.func = func
def __ror__(self, other):
...
分类:
其他好文 时间:
2014-10-11 20:20:36
阅读次数:
184
import paramikodef fw_exec(self, command): def fw_exec(self, command): FW_USER = '' FW_PASSWD = '' FW_HOST = '' paramiko.util.log_to_fi...
分类:
编程语言 时间:
2014-10-11 17:02:35
阅读次数:
256
最近在写一个LBS的项目的时候,因为考虑到适配iOS8,就将项目迁移到Xcode6.0.1上,出现了不能正常获取定位服务权限的问题。self.manger = [[CLLocationManager alloc]init];self.manger.distanceFilter = kCLDistan...
分类:
移动开发 时间:
2014-10-11 15:22:45
阅读次数:
163
问题:在导航控制器的当前视图中的标题中用一张图片代替文本使用导航项目中视图控制器中 navigation item 的 titleView 属性:- (void)viewDidLoad{[super viewDidLoad];self.view.backgroundColor = [UIColor ...
分类:
其他好文 时间:
2014-10-11 15:19:25
阅读次数:
159
- (void) goBack{/* Get the current array of View Controllers */NSArray *currentControllers = self.navigationController.viewControllers; /* Create a mu...
分类:
编程语言 时间:
2014-10-11 14:07:15
阅读次数:
115
效果图:代码:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. //初始化背景图 [self initBackgroundView]...
分类:
其他好文 时间:
2014-10-11 12:02:35
阅读次数:
210