摘要:
建一个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时退出键盘- 阅读全文
摘要:
#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 阅读全文
摘要:
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 阅读全文