05 2014 档案
摘要://1.调用通知进行回调方法//A控制器中- (void)toDo{ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(test) name:@"testName" object:nil];}//...
阅读全文
摘要://1.1获取在Xcode项目打开的情况下创建的Plist文件 NSString *path = [[NSBundle mainBundle]pathForResource:@"ProfessionClassify" ofType:@"plist"]; //1.2定义数组接收文件 NSMutabl...
阅读全文
摘要:@interface ProfessionViewController (){ NSMutableArray *_professionArray;//cell模型数组 NSMutableArray *_selectArray; //已选中的cell数组}- (void)view...
阅读全文
摘要://在viewDidLoad方法中创建Toolbartoolbar = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 66)];toolbar.backgroundColor = [UIColor redColor];//添加到tableVi...
阅读全文
摘要:NSData *webData = [ @"{\"1\": {\"name\": \"Jerry\",\"age\": \"12\"}, \"2\": {\"name\": \"Bob\",\"age\": \"1...
阅读全文
摘要://创建当前日期 NSDate *date = [NSDate date]; //创建日期格式类 NSDateFormatter *dateFormat = [[NSDateFormatter alloc]init]; //设置日期格式 [dateFormat ...
阅读全文
摘要://创建UIBarButtonItemUIBarButtonItem * rightButton = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:nil...
阅读全文
摘要:for (int i = 0; i < 4; i++) {//4是按钮的个数 NSString *backImage = backgroud[i]; NSString *heightImage = heightBackground[i]; ...
阅读全文
摘要://1.创建toolbar(MyToolbar继承UIToolbar) _myToolbar = [[MyToolbar alloc]initWithFrame:CGRectMake(kZero, kZero, kScreenW, kToolbarH)]; _myToolbar.ba...
阅读全文
摘要:UITabBarItem *firstItem = [[UITabBarItem alloc]initWithTitle:@"测试" image:nil tag:11]; //设置字体颜色(后面设置字体状态)(UITextAttributeTextColor已过时) [firstItem ...
阅读全文
摘要:1 //设置圆形cornerRadius,是宽或高的一半 2 3 _imageView.layer.masksToBounds = YES; 4 5 6 7 CGFloat w = _imageView.frame.size.width / 2; 8 9 ...
阅读全文
摘要:1 //UIAlertView的代理方法(创建UIAlertView之后,copy此代理方法即可) 2 3 - (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView{ 4 5 //1.取出输入框中的文字 ...
阅读全文
摘要:1 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 2 3 //1.取消选中这一行 4 5 [tableView deselectRowAtInde...
阅读全文
摘要:1 2 3 //MyToolbar.h 头文件 4 @interface MyToolbar : UIToolbar 5 6 @end 7 8 //MyToolbar.m 实现文件 9 #import "MyToolbar.h"10 11 @implementation MyToolba...
阅读全文
摘要:1 //1.创建toolbar左边的按钮,调用initWithTitle方法进行初始化2 3 // UIBarButtonItem *extend = [[UIBarButtonItemalloc]initWithTitle:@"扩展"style:UIBarButtonItemStylePlai...
阅读全文