08 2014 档案

摘要:多态性:以子类的方法初始化父类对象。class A:BB b = [[A alloc]init];//此时在调用init方法,是调用的子类的init 而不是父类的init[b init]; //此init是子类A的init方法 阅读全文
posted @ 2014-08-11 22:56 迷茫的程序小生 阅读(105) 评论(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 迷茫的程序小生 阅读(172) 评论(0) 推荐(0)
摘要:-(void)viewDidLoad{ [super viewDidLoad]; //uiimage UIImage *img = [[UIImageView alloc]initWithImage:img]; //image view self.imageView = [[UIImage... 阅读全文
posted @ 2014-08-11 14:42 迷茫的程序小生 阅读(120) 评论(0) 推荐(0)
摘要:用处:选择日期或时间 当选择新的日期或时间的时候,值改变事件会被触发-(void)viewDidLoad{ CGRect frame = CGRectMake(20,20,320,100); self.datePicker = [[UIDatePicker alloc]initWithFrame... 阅读全文
posted @ 2014-08-07 16:53 迷茫的程序小生 阅读(132) 评论(0) 推荐(0)
摘要:用处: 菊花图仅有两个方法:[aiv startAnimating] [aiv stopAnimating]-(void)viewDidLoad{ [super viewDidLoad]; self.aiv = [[UIActivityIndicatorView alloc]init... 阅读全文
posted @ 2014-08-07 14:41 迷茫的程序小生 阅读(119) 评论(0) 推荐(0)
摘要:用处:进度条视图,用来显示某个任务的当前状态-(void)viewDidLoad{ [self viewDidLoad]; self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(... 阅读全文
posted @ 2014-08-07 13:56 迷茫的程序小生 阅读(160) 评论(0) 推荐(0)
摘要:1.定义好的xib文件rootView.xib,选中files·owners 在class中选择对应的viewController2.如何在window中指定rootViewController------在appdelegate.h中声明属性 @property (strong,nonatomic... 阅读全文
posted @ 2014-08-07 10:02 迷茫的程序小生 阅读(247) 评论(0) 推荐(0)
摘要:用处:多分段选择控件,选中某个分段会触发值改变事件。-(void)viewDidLoad{ [super viewDidLoad]; NSArray* items = @[@"a",@"b",@"c"]; self.seg = [[UISegmentedControl alloc]initW... 阅读全文
posted @ 2014-08-06 17:20 迷茫的程序小生 阅读(137) 评论(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 迷茫的程序小生 阅读(164) 评论(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 迷茫的程序小生 阅读(171) 评论(0) 推荐(0)
摘要:用处:输入控件-(void)viewDidLoad{ [super viewDidLoad];//设置大小CGRect frame = CGRectMake(20,20,150,40);//实例化UITextFieldself.tf = [[UITextField alloc]initWithFra... 阅读全文
posted @ 2014-08-06 14:56 迷茫的程序小生 阅读(116) 评论(0) 推荐(0)
摘要:含义:当某个事件发生时,调用某个对象的某个方法一般情况下,对象就是target,方法就是actiontarget是controller,action是action使用方法:1,创建按钮2,在controller.h文件中声明action3,在controller.m文件中实现action3,给but... 阅读全文
posted @ 2014-08-06 14:37 迷茫的程序小生 阅读(304) 评论(0) 推荐(0)
摘要:-(void)viewDidLoad{//初始化self.btn1 = [UIBotton buttonWithType:UIButtonTypeRoundedRect];//设置大小self.btn1.frame = CGRectMake(20,20,100,50);//设置标题[self.btn... 阅读全文
posted @ 2014-08-06 14:17 迷茫的程序小生 阅读(201) 评论(0) 推荐(0)
摘要:从今天起,开始学习UIKit部分,在此做个记录,不会充分详细的解释细节,只是要做一个备忘一样的东西。1.UIView类继承自UIResponder继承自NSObject2.UIResponder类定义了一些操作3.UIView有三个属性: frame, bounds, center frame用于... 阅读全文
posted @ 2014-08-06 11:39 迷茫的程序小生 阅读(142) 评论(0) 推荐(0)