Fur*_*rqi 5 iphone contact-list
- (void)viewDidLoad {
[super viewDidLoad];
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"2.png"] style:UIBarButtonItemStyleBordered target:self action:nil];
self.navigationItem.rightBarButtonItem = btn;
self.navigationItem.title = @"Contacts";
sBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0,0,320,30)];
sBar.delegate = self;
[self.view addSubview:sBar];
sBar.placeholder=@"Search";
searchedData = [[NSMutableArray alloc]init];
tableData = [[NSMutableArray alloc]init];
[tableData addObjectsFromArray:dataSource];
}
Run Code Online (Sandbox Code Playgroud)
您将需要实现以下表委托方法才能真正让表显示数据。
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
Run Code Online (Sandbox Code Playgroud)
您可以在这里找到更多文档UITableView
| 归档时间: |
|
| 查看次数: |
894 次 |
| 最近记录: |