2012年3月8日
摘要: 建一个Single View Application的project。部分代码:#import <UIKit/UIKit.h>@interface BIDViewController : UIViewController@property (strong, nonatomic) IBOutlet UITextField *nameField;@property (strong, nonatomic) IBOutlet UITextField *numberField;- (IBAction)textFieldDoneEditing:(id)sender;//为了Done时退出键盘- 阅读全文
posted @ 2012-03-08 14:21 老Zhan 阅读(311) 评论(0) 推荐(0) 编辑
摘要: #import <UIKit/UIKit.h>@class BIDViewController;@interface BIDAppDelegate : UIResponder <UIApplicationDelegate>@property (strong, nonatomic) UIWindow *window;@property (strong, nonatomic) BIDViewController *viewController;@end#import "BIDAppDelegate.h"#import "BIDViewContr 阅读全文
posted @ 2012-03-08 11:16 老Zhan 阅读(318) 评论(0) 推荐(0) 编辑
摘要: strong关键字与retain关似,用了它,引用计数自动+1,用实例更能说明一切@property(nonatomic,strong)NSString*string1; @property(nonatomic,strong)NSString*string2; 有这样两个属性,@synthesizestring1; @synthesizestring2; 猜一下下面代码将输出什么结果?self.string1=@"String1"; self.string2=self.string1; self.string1=nil; NSLog(@"String2=%@&qu 阅读全文
posted @ 2012-03-08 10:53 老Zhan 阅读(24509) 评论(11) 推荐(3) 编辑