一、关键字说明1.@synthesize关键字:根据@property设置,自动生成成员变量相应的存取方法,从而可以使用点操作符来方便的存取该成员变量。2.@implementation关键字:表明类的实现@end结束3.self关键字:类似于java中的this,是隐藏参数,指向当前调用方法的类。...
分类:
移动开发 时间:
2015-06-18 18:46:08
阅读次数:
136
使用new创建对象时,系统其实在后台执行了两个步骤:
第一步:为对象分配内存,即对象获得一个用来存放实例变量的内存块;
第二部:自动调用 init 方法,使对象进入可用状态。注:alloc 的内部实现用的是 new。@implementation Car
- (id) init
{
if (self = [super init]) {
engine = [Engine new...
分类:
其他好文 时间:
2015-06-18 17:26:13
阅读次数:
107
super在Objective-C中,如果我们需要在类的方法中调用父类的方法时,通常都会用到super,如下所示:@interface MyViewController: UIViewController @end @implementation MyViewController - (void)v...
分类:
其他好文 时间:
2015-06-18 17:06:12
阅读次数:
107
一. 系统导航默认手势#import "CBNavigationController.h"//手势返回@interface CBNavigationController ()@end@implementation CBNavigationController- (void)viewDidLoad{ ...
分类:
其他好文 时间:
2015-06-18 09:26:07
阅读次数:
101
#import "DengViewController.h"#import @interface DengViewController ()@end@implementation DengViewController@synthesize arrayStrig=_arrayStrig;//@synt...
分类:
其他好文 时间:
2015-06-17 11:05:16
阅读次数:
99
/* * FIPS-197 compliant AES implementation * * Copyright (C) 2006-2007 Christophe Devine * * Redistribution and use in source and binary forms, wi...
分类:
其他好文 时间:
2015-06-17 00:13:54
阅读次数:
238
读取以下两种格式的Excel : *.xls and *.xlsx用Apache POI API来实现,需要用到 HSSF 和 XSSF 的类库HSSF is the POI Project's pure Java implementation of the Excel '97(-2007) (.x...
分类:
编程语言 时间:
2015-06-16 18:54:44
阅读次数:
220
利用Method Swizzling 来抽取重复的操作by 伍雪颖重复操作如数据上报,公共特性等等.1.建立UIViewController的Category
2.代码:#import "UIViewController+Analytics.h"
#import @implementation UIViewController (Analytics)+ (vo...
分类:
其他好文 时间:
2015-06-16 11:12:19
阅读次数:
161
第一种 1 #import "AppDelegate.h" 2 #import "DJOneViewController.h"//新建一个空的视图控制器 3 @interface AppDelegate () 4 5 @end 6 7 @implementation AppDelegate 8 .....
分类:
其他好文 时间:
2015-06-15 09:06:03
阅读次数:
127
#import "UIStoryboard+WF.h"@implementation UIStoryboard (WF)+(void)showInitialVCWithName:(NSString *)name{ UIStoryboard *storyboard = [UIStoryboard...
分类:
其他好文 时间:
2015-06-15 01:44:42
阅读次数:
237