Ios

594 views
542 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
594
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Ios

  1. 1. Objective C• NSString *string = @"12.3"; NSScanner *scanner = [NSScanner scannerWithString:string]; double *aNumber = [scanner scanDouble];
  2. 2. @property• @property (nonatomic,retain) UILabel* label – NonAtomic 节省一些开销 – Retain 保证变量使用过程中不会被清除• @synthesize statusText – 通知编译器创建statusText和setStatusText两方法• 声明操作方法: – -(IBAction) btnPress : (id)sender; – -(IBAction) btnPress : (UIButton*)sender;
  3. 3. 关闭键盘• 把Controller.xib的class从View改成UIControl• 再设置窗口的touch up事件设置到closeKbd• Action: – -(IBAction) closeKbd : (id) sender{ • [textField resignFirstResponser;] –}
  4. 4. 多视图应用• 建一个windows base app• 添加3个view controll – Switcher, redViewController,blueViewController• 在AppDelegate.m里加 – #import “switcher.h” – [self.window addSubview:switcher.view];
  5. 5. • 控件与delegate关联,才能在程序里修改它 – Delete 与 windows关联 – 才能 window addSubView….

×