我有一個應用程序(導航控制器),其中第二個控制器是一個表視圖控制器。我能夠通過segue發送我所需的數據,但無法以編程方式更新tableview中的條目。UITableView&Controller給我空表視圖
我是IOS新手。
這是我的頭文件
#import <UIKit/UIKit.h>
@interface HCIResultListViewController : UITableViewController
@property (strong,nonatomic) NSMutableDictionary *resultList;
@property (strong, nonatomic) IBOutlet UITableView *tableListView;
@end
這是我的執行文件。
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 0;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"HelloCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = @"Hello";
// Configure the cell...
return cell;
}
誰能告訴我如何與實現代碼如下&控制器工作?
我沒有經歷幾個文檔和示例,但真的想不出瞭解
'numberOfRowsInSection'&'numberOfSectionsInTableView'返回0號碼 – 2013-03-06 10:40:56
非常抱歉這個問題!只是一個小俯瞰! – 2013-03-06 11:59:28