摘要: 多态性:以子类的方法初始化父类对象。class A:BB b = [[A alloc]init];//此时在调用init方法,是调用的子类的init 而不是父类的init[b init]; //此init是子类A的init方法 阅读全文
posted @ 2014-08-11 22:56 迷茫的程序小生 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 用处:实现一个web浏览器,加载静态html,动态url,调用js//加载动态urlself.webView = [[UIWebView alloc]initWithFrame:self.view.bounds];NSString *str = @"http://www.baidu.com";NSU... 阅读全文
posted @ 2014-08-11 15:11 迷茫的程序小生 阅读(166) 评论(0) 推荐(0) 编辑
摘要: -(void)viewDidLoad{ [super viewDidLoad]; //uiimage UIImage *img = [[UIImageView alloc]initWithImage:img]; //image view self.imageView = [[UIImage... 阅读全文
posted @ 2014-08-11 14:42 迷茫的程序小生 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 用处:选择日期或时间 当选择新的日期或时间的时候,值改变事件会被触发-(void)viewDidLoad{ CGRect frame = CGRectMake(20,20,320,100); self.datePicker = [[UIDatePicker alloc]initWithFrame... 阅读全文
posted @ 2014-08-07 16:53 迷茫的程序小生 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 用处: 菊花图仅有两个方法:[aiv startAnimating] [aiv stopAnimating]-(void)viewDidLoad{ [super viewDidLoad]; self.aiv = [[UIActivityIndicatorView alloc]init... 阅读全文
posted @ 2014-08-07 14:41 迷茫的程序小生 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 用处:进度条视图,用来显示某个任务的当前状态-(void)viewDidLoad{ [self viewDidLoad]; self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(... 阅读全文
posted @ 2014-08-07 13:56 迷茫的程序小生 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1.定义好的xib文件rootView.xib,选中files·owners 在class中选择对应的viewController2.如何在window中指定rootViewController------在appdelegate.h中声明属性 @property (strong,nonatomic... 阅读全文
posted @ 2014-08-07 10:02 迷茫的程序小生 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 用处:多分段选择控件,选中某个分段会触发值改变事件。-(void)viewDidLoad{ [super viewDidLoad]; NSArray* items = @[@"a",@"b",@"c"]; self.seg = [[UISegmentedControl alloc]initW... 阅读全文
posted @ 2014-08-06 17:20 迷茫的程序小生 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 用处:在一个连续的区间中选择一个值-(void)viewDidLoad{ [super viewDidLoad]; CGRect frame = CGRectMake(20,20,200,0); self.slider = [[UISlider alloc]initWithFrame:fra... 阅读全文
posted @ 2014-08-06 16:12 迷茫的程序小生 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 用处:开关空间,用于处理两种状态-(void)viewDidLoad{ [super viewDidLoad]; CGRect frame = CGRectMake(20,20,0,0); self.switch = [[UISwitch alloc]initWithFrame:frame]; //... 阅读全文
posted @ 2014-08-06 15:25 迷茫的程序小生 阅读(161) 评论(0) 推荐(0) 编辑