1.__weak typeof(self) myself = self;2.__weak RecommendViewController *recommendVC = self;以上两种写法是一种效果typeof(self) 是获取到self的类型,这样定义出的weakSelf就是和self一个类型...
分类:
其他好文 时间:
2016-01-06 23:50:20
阅读次数:
481
UIWindow和ViewController:window —>JWViewController - 其他的控制器—>view —> btnUIWindow:是个特殊的UIView,通常一个程序只有一个window。可以查看官方文档(有中文版的)addSubView:rootViewControl...
分类:
其他好文 时间:
2016-01-06 15:39:44
阅读次数:
127
1.效果如下:2.UINavigationController,导航控制器也是UIViewController的子类(1)在Appdelegate.h中 设置UIWindow及其根控制器为导航控制器,代码如下:- (BOOL)application:(UIApplication *)applicat...
分类:
其他好文 时间:
2016-01-04 23:49:09
阅读次数:
176
UIWindow是UIView的子类,一个程序只能有一个window主窗口.在XCode7之后我们创建UIWindow的对象,代码如下: //创建一个窗口,使其铺满屏幕(设置大小) 初始化的时候不要用self.window,这样相当于先调用setter方法再申请空间,可能会出现传值错误 ...
#import @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window;@end#import "AppDelegate.h"#import "Firs...
分类:
移动开发 时间:
2015-12-29 00:59:39
阅读次数:
2040
定义block的时候,会对外部变量做一次copy,会对self进行强引用1.__weak是ios 5.0 推出的__weak 相当于weak 本身是弱引用,但是如果对象被释放,执行的地址会指向nil 更安全__weak typeof(self) weakSelf = self;2__unsafe_u...
分类:
其他好文 时间:
2015-12-28 01:00:36
阅读次数:
215
#import @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window;@end#import "AppDelegate.h"#import "KeyViewCo...
分类:
移动开发 时间:
2015-12-25 16:32:24
阅读次数:
191
#import @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window;@end#import "AppDelegate.h"#import "KeyViewCon...
分类:
移动开发 时间:
2015-12-25 15:11:47
阅读次数:
172
有三种方式:mysql-connector,MySQLdb,torndb(对MySQLdb的二次封装)mysql-connector:游标是弱引用,无法封装成函数MySQLdb:可以封装成函数torndb:返回值可以转换成字典from__future__importprint_function
sql=(‘SELECT*fromipdatalimit10‘)
#mysql-connector
print(‘mysql..
分类:
数据库 时间:
2015-12-22 06:34:18
阅读次数:
224
1 UIWindow、UILabel、UIColor、UIScreen、UIViewController、UIView、UIControl、UIButton、IBOutlet、IBAction、UIStepper、 UISlider、 UISwitch、UITextField、UIA...
分类:
其他好文 时间:
2015-12-21 14:23:53
阅读次数:
249