08 2012 档案

摘要:nil:指向oc中对象的空指针Nil:指向oc中类的空指针NULL:指向其他类型的空指针,如一个c类型的内存指针NSNull:在集合对象中,表示空值的对象若obj为nil:[obj message]将返回NO,而不是NSException若obj为NSNull:[obj message]将抛出异常NSExceptionuse :数值类对象:NSNumber,NSValue,NSNull基本,集合,复杂,对象可用对象封装基本数值,然后将对象放入NSArray或NSDictionary 中。用对象封装基本数值后,即可给其发送消息。将一个基本类型的数据包装成对象叫做装箱(boxing),从对象中取出 阅读全文
posted @ 2012-08-29 17:48 大树2 阅读(5835) 评论(1) 推荐(0) 编辑
摘要:iPhone开发之NSNotificationCenter(通知)的使用方法NSNotificationCenter 是 Cococa消息中心,统一管理单进程内不同线程的消息通迅,其职责只有两个:1,提供“观查者们”对感兴趣消息的监听注册; [[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(printName:)name:@"messageName"object:nil];a, defaultCenter,消息中心只有一个,通过类方法获取它的单例。b, addObserver,添加监 阅读全文
posted @ 2012-08-29 16:49 大树2 阅读(18088) 评论(2) 推荐(4) 编辑
摘要:Objective -c Content1、面向对象(OOP)和面向过程、类(Class)和对象(Object)、类的定义2、创建对象、self和super关键字、属性以及点语法(nonatomic,assign、retain、copy、readonly、readwrite)3、便利构造器、单例(Singleton)4、堆栈、内存管理(alloc、copy、retain,release、autorelease、strong、weak)5、键值编码(KVC)、键值监听(KVO)、通知中心(NSNotificationCenter)、通知(NSNotification)6、类目(Category) 阅读全文
posted @ 2012-08-28 10:32 大树2 阅读(968) 评论(0) 推荐(0) 编辑
摘要:NSObject UIResponder UIView UIWindow UILabel UIPickerView UIProgressView UIImageView UITabBar UIToolBar UINavigateBar UITableViewCell UIActionSheet UIAlertV... 阅读全文
posted @ 2012-08-22 15:32 大树2 阅读(1132) 评论(0) 推荐(0) 编辑
摘要:IOS 小技巧1. 使用@property和@synthesize声明一个成员变量,给其赋值是时要在前面加上"self.",以便调用成员变量的setmember方法。 直接调用成员变量并且给其赋值:member=[NSString stringWithFormat:@””];将不执行setmember 方法。 使用self调用成员变量并且给其赋值:self.member=[NSString stringWithFormat:@””];将执行setmember方法。2.延时函数: [NSThread sleepForTimeInterval:3]; [self perform 阅读全文
posted @ 2012-08-22 14:59 大树2 阅读(572) 评论(0) 推荐(0) 编辑
摘要:通常引用一个类有两种办法: 一种是通过#import方式引入; 另一种是通过@class引入;#improt: 会包含被引用类的所有信息;@class方式只是告诉编译器在A.h文件中B *b只是类的声明,具体这个类里有什么信息,这里不需要知道,等实现文件中真正要用到时,才会真正去查看B类中信息;1、#import方式会包含被引用类的所有信息,包括被引用类的变量和方法;@class方式只是告诉编译器在A.h文件中B *b只是类的声明,具体这个类里有什么信息,这里不需要知道,等实现文件中真正要用到时,才会真正去查看B类中信息;2、使用@class方式由于只需要只要被引用类(B类)的名称就可以了,. 阅读全文
posted @ 2012-08-22 13:42 大树2 阅读(672) 评论(0) 推荐(0) 编辑
摘要:1 UIView UIWindow UILable UIProcessVIEW UITabar2 UIViewController UITableViewController UINavigateViewController三个结构体:CGPoint、CGSize、CGRect1. CGPointC代码 /*Points.*/ structCGPoint{ CGFloatx; CGFloaty; }; typedefstructCGPointCGPoint;看到这个想必你已经懂了,不再解释。2. CGSizeC代码 /*... 阅读全文
posted @ 2012-08-22 13:34 大树2 阅读(4200) 评论(0) 推荐(1) 编辑
摘要:1 iphone background ipad,iphone,ipod touch2 history: 2007.6 iphone sale in us 2008.6, iphone 3 2010.6 iphone 4 2010.1 ipad3 appstore over 300,000 programs download 10 billion times "angry bird"4 iPhone development environment hard ware: mac book or desktop iphone/ipad/ipod ... 阅读全文
posted @ 2012-08-22 13:13 大树2 阅读(481) 评论(0) 推荐(0) 编辑
摘要:1AppDelegate.h#import <UIKit/UIKit.h>@class ViewController;@interface AppDelegate : UIResponder <UIApplicationDelegate>@property (strong, nonatomic) UIWindow *window;@property (strong, nonatomic) ViewController *viewController;@property (strong,nonatomic) UINavigationController *navigati 阅读全文
posted @ 2012-08-21 16:02 大树2 阅读(1708) 评论(1) 推荐(2) 编辑
摘要:1 appdelegate.h 定义属性:window,navigationViewController@interface AppDelegate : UIResponder <UIApplicationDelegate>@property (strong, nonatomic) UIWindow *window;@property (strong, nonatomic) UINavigationController *navigationViewController;@end2 appdelegate.m对属性初始化,窗口初始化@implementation AppDelega 阅读全文
posted @ 2012-08-16 23:01 大树2 阅读(1541) 评论(0) 推荐(0) 编辑
摘要:1 appdelegate.m#import"AppDelegate.h"#import"FirstViewController.h"#import"SecondViewController.h"#import"ThridViewController.h"{ self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization a 阅读全文
posted @ 2012-08-16 18:01 大树2 阅读(967) 评论(0) 推荐(0) 编辑
摘要:UIViewController use1 appdelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launc.. 阅读全文
posted @ 2012-08-16 17:11 大树2 阅读(379) 评论(0) 推荐(0) 编辑
摘要:frame: 该view在父view坐标系统中的位置和大小。(参照点是,父亲的坐标系统) bounds:该view在本地坐标系统中的位置和大小。(参照点是,本地坐标系统) center:该view的中心点在父view坐标系统中的位置和大小。(参照电是,父亲的坐标系统)搞iOS开发的童鞋基本都会用过UIView,那他的bounds和frame两个属性也不会陌生,那这两个有什么实质性的区别呢?先看到下面的代码你肯定就明白了一些:-(CGRect)frame{return CGRectMake(self.frame.origin.x,self.frame.origin.y,self.fr... 阅读全文
posted @ 2012-08-02 17:25 大树2 阅读(3574) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示