Objective-C的@selector在Swift中用Selector结构体来替代。在Swift中,我们可以使用字符串常量来构造Selector,例如:
let mySelector: Selector = "tappedButton:"
因为字符串最终会被自动转换成Selector。下面是一个例子:
// Swift
myButton.addTarget(self, ac...
分类:
编程语言 时间:
2014-11-01 13:29:59
阅读次数:
215
#mongodb study - 读到101个记录不动了,卡住的语句好像是网络不通: > File "/Library/Python/2.7/site-packages/pymongo/cursor.py", line 1058, in next if len(self.__data) or self._refresh(): File "/Libr...
分类:
数据库 时间:
2014-10-31 22:21:27
阅读次数:
331
反射的具体应用,自动绑值获取属性列表 1 - (NSArray*)propertyKeys 2 { 3 unsigned int outCount, i; 4 objc_property_t *properties = class_copyPropertyList([self cla...
分类:
移动开发 时间:
2014-10-31 18:42:27
阅读次数:
335
class SortClass: NSObject { func quickSort(inout array:[Int]){ self.quick(&array, left: 0, right: array.count-1) } func quickMain(...
分类:
编程语言 时间:
2014-10-31 11:39:31
阅读次数:
228
在UITableView中,经常有很多表单需要输入,有的表单比较靠下,一点击输入时键盘就会弹出,弹出有时候会盖住输入框,那怎么办呢?调用下面的方法,当然你输入的UITextField要有delegate = self。 当前的viewController要实现UITextFieldDelegate。...
分类:
其他好文 时间:
2014-10-31 11:35:34
阅读次数:
191
vim~/.emma/emmarc db_encoding=latin1 改为db_encoding=utf8 sudovim/usr/share/emma/emmalib/mysql_host.py跳到155行左右的_use_db(self, name, do_query=True),改成如下de...
分类:
其他好文 时间:
2014-10-31 11:35:16
阅读次数:
199
不能调用self.navigationController.navigationBar.hidden = YES;调用此代码的话,你隐藏了navigationBar搜索展示控制器就拿不到导航条;就会再搞一个navigationBar,搜索展示控制器是要替换导航条的。(当点击searchBar时,它会...
分类:
其他好文 时间:
2014-10-30 23:53:30
阅读次数:
256
在ios6以前,我们有如下的方法:
#import
[[AVAudioSession sharedInstance] setDelegate:self];
AudioSessionAddPropertyListener(kAudioSessionProperty_AudioRouteChange,audioRouteChangeL...
分类:
移动开发 时间:
2014-10-30 15:20:44
阅读次数:
216
UIViewController *viewController = [[UIViewController alloc]init];UIViewController* controller = self.view.window.rootViewController;viewController.vi...
分类:
移动开发 时间:
2014-10-30 15:11:36
阅读次数:
205
1、首先将toolbar显示出来,在viewDidLoad中添加代码让toolbar显示,代码如下:[objc]view plaincopyprint?[self.navigationControllersetToolbarHidden:NOanimated:YES] 显示如下图:2、在ToolB....
分类:
移动开发 时间:
2014-10-30 10:48:21
阅读次数:
210