会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
春新
博客园
首页
新随笔
联系
订阅
管理
1
2
下一页
2016年7月1日
自定义一个打印宏来替换 NSLog
摘要: #ifdef DEBUG #define FCZLog(...) NSLog(__VA_ARGS__) #else #define FCZLog(...) #endif debug模式会替换nslog,release模式会直接去掉。
阅读全文
posted @ 2016-07-01 14:41 春新
阅读(179)
评论(0)
推荐(0)
2016年6月30日
给category添加属性的方法
摘要: 默认类别时无法添加属性的,但可以动态添加,利用runtime机制 #import static const void * externVariableKey =&externVariableKey; @implementation NSObject (Category) @dynamic varia
阅读全文
posted @ 2016-06-30 11:56 春新
阅读(217)
评论(0)
推荐(0)
2016年6月29日
协议的继承
摘要: 共有方法都可以继承下来 @protocol OneDelegate <nsobject> @required - (void)backStr:(NSString *)str; @end @protocol TwoDelegate <onedelegate> @optional - (void)bac
阅读全文
posted @ 2016-06-29 15:59 春新
阅读(145)
评论(0)
推荐(0)
一个类当中有多个@interface 和多个@implementation
摘要: 这种写法有两个好处: 1.节省几个文件。 2.这几个类互相之间不需要再引入。对于别的类,当你引入这个 .h 文件的时候,把这几个类都一起引入了。 第 2 点也可以看做一个破坏封装性的缺点了。所以这样做是比较少见的,仅在定义一些数据结构的时候会这样用。比如像你举的例子中,如果是数据类,里面主要以属性为
阅读全文
posted @ 2016-06-29 15:44 春新
阅读(1468)
评论(0)
推荐(0)
2016年6月28日
appdelegate的几个方法(应用程序的生命周期)
摘要: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //在程序启动之后,重写自定义设置的位置 return YES; } -(vo
阅读全文
posted @ 2016-06-28 13:48 春新
阅读(1224)
评论(0)
推荐(0)
IOS 中的_cmd
摘要: OC的编译器在编译后会在每个方法中加两个隐藏的参数:一个是_cmd,当前方法的一个SEL指针。一个是self,指向当前对象的一个指针。 demo: //应用程序退出后执行代码 - (void)applicationWillTerminate:(UIApplication *)application
阅读全文
posted @ 2016-06-28 11:59 春新
阅读(2430)
评论(0)
推荐(0)
2016年6月27日
一些写代码的常见规范
摘要: 1.用在.h 文件的@class 和.m文件的#import 替代 .h文件的#import 2.多用字面量 NSNumber *number =@1;替代 NSNumber *number = [NSNumber numberWithInt:1]; 3.多用类型常量,少用宏定义 static ns
阅读全文
posted @ 2016-06-27 14:29 春新
阅读(250)
评论(0)
推荐(0)
一个第三方的分段器 HMSegmentControl
摘要: 基本的属性和用法: _contentSwitch = [[HMSegmentedControl alloc] initWithSectionTitles:@[MGJLPLocalizedString(@"lifestyle_publish_what_i_posts", @"关注"), MGJLPLo
阅读全文
posted @ 2016-06-27 14:14 春新
阅读(984)
评论(0)
推荐(0)
2016年6月24日
Objective-LevelDB
摘要: 谷歌开发的数据库,效率很高。小数据存储可以使用这个,比如搜索的历史记录显示,移除等。大数据使用FMDB.
阅读全文
posted @ 2016-06-24 17:25 春新
阅读(246)
评论(0)
推荐(0)
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil;
摘要: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
阅读全文
posted @ 2016-06-24 17:01 春新
阅读(1545)
评论(0)
推荐(0)
1
2
下一页
公告