摘要: http://blog.csdn.net/kaizi318/article/details/8294127每一个进程都有一个默认的NSNotificationCenter,可以通过类方法defaultCenter获取该消息中心的实例。消息中心可以处理同一进程中不同对象之间的消息。如果要在同一台机器上进行进程间的通信,需要使用NSDistributedNotificationCenter。消息中心以同步的方式将消息分发到所有的观察者中,换言之,直到所有的观察者都收到消息并处理完毕以后,控制权才会回到调用者的手里。 1 //第一步:实现回调函数 2 -(void)callback 3 { 4 .. 阅读全文
posted @ 2013-01-24 16:28 仙外仙 阅读(445) 评论(0) 推荐(0) 编辑
摘要: 1 #import <Foundation/Foundation.h> 2 3 //TWFXStuData类作为Model层里的类,用于管理数据 4 @interface TWFXStuData : NSObject 5 { 6 NSString *Name; 7 NSInteger Age; 8 } 9 10 @property (retain, nonatomic) NSString *schoolName;11 12 @end13 14 15 16 17 #import "TWFXStuData.h"18 19 @implementation TWFXSt 阅读全文
posted @ 2013-01-24 14:36 仙外仙 阅读(340) 评论(0) 推荐(1) 编辑
摘要: toolbar除了可以和navigationController一起用之外,也可以独立用到view里 1 // 2 // TWFXToolBarViewController.m 3 // DemoToolBar 4 // 5 // Created by Lion User on 13-1-19. 6 // Copyright (c) 2013年 Lion User. All rights reserved. 7 // 8 9 #import "TWFXToolBarViewController.h" 10 11 @interface TWFXToolBarView... 阅读全文
posted @ 2013-01-19 14:42 仙外仙 阅读(8803) 评论(0) 推荐(0) 编辑
摘要: 文件目录如下:基本导航顺序: root -> First -> Second -> Third。其中,FirstViewController作为 navigation堆栈的rootview1、创建navigation。如果是想直接把navigation导航作为项目一开始的跟视图,把RootViewController.h文件里的nav属性放到AppDelegate.h里即可,再把RootViewController.m文件里的action的代码复制到 AppDelegate.m里的didFinishLaunchingWithOptions 方法里,最后把 self.windo 阅读全文
posted @ 2013-01-17 15:09 仙外仙 阅读(8902) 评论(0) 推荐(0) 编辑
摘要: 1 // 2 // TWFXSecondViewController.m 3 // DemoMultiView 4 // 5 // Created by Lion User on 12-12-24. 6 // Copyright (c) 2012年 Lion User. All rights reserved. 7 // 8 9 #import "TWFXSecondViewController.h" 10 #import "TWFXThirdViewController.h" 11 12 @interface TWFXSecondViewControl 阅读全文
posted @ 2013-01-14 12:32 仙外仙 阅读(19319) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 实现tableview的下拉刷新 3 tableview滑动就会触发这个方法? 4 */ 5 -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 6 { 7 //当tableview下拉到最后一行的时候才触发 8 if (indexPath.row == self.m_data.count - 1) { 9 10 ... 阅读全文
posted @ 2012-12-17 17:08 仙外仙 阅读(5510) 评论(0) 推荐(2) 编辑
摘要: xib文件就放了四个button和四个label 1 // 2 // TWFXViewController.h 3 // Demo_GCD 4 // 5 // Created by Lion User on 12-12-11. 6 // Copyright (c) 2012年 Lion User. All rights reserved. 7 // 8 9 #import <UIKit/UIKit.h>10 11 @interface TWFXViewController : UIViewController12 13 @property (retain, nonatomic) I 阅读全文
posted @ 2012-12-13 17:07 仙外仙 阅读(1121) 评论(0) 推荐(0) 编辑
摘要: xib界面 就放6个UIButton,并将他们的Touch Up Inside 事件与 .h文件里的IBAction关联起来;另外还有两个UILabel,把他们的Outlet与 .h文件里的输出口关联起来就行了. 1 #import <UIKit/UIKit.h> 2 #import "TWFXAppDelegate.h" 3 4 @interface TWFXViewController : UIViewController 5 { 6 NSOperationQueue *operationQueue; 7 } 8 9 @property (retain, n 阅读全文
posted @ 2012-12-11 14:56 仙外仙 阅读(955) 评论(0) 推荐(0) 编辑
摘要: 1 #import <UIKit/UIKit.h>2 3 @interface TWFXViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>4 5 - (IBAction)btnClick:(UIButton *)sender;6 @property (retain, nonatomic) IBOutlet UITextField *textOutlet;7 @property(nonatomic,retain) NSMutableArray *mdata;8 9 @en 阅读全文
posted @ 2012-11-28 20:03 仙外仙 阅读(4271) 评论(0) 推荐(0) 编辑
摘要: 1 - (void)viewDidLoad 2 { 3 [super viewDidLoad]; 4 // Do any additional setup after loading the view, typically from a nib. 5 6 //第一种方法创建 7 UIButton *newBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 8 9 newBtn.frame = CGRectMake(50.0f, 50.0f, 100.0f, 50.0f);... 阅读全文
posted @ 2012-11-21 23:15 仙外仙 阅读(1113) 评论(0) 推荐(0) 编辑