
我是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;} 谁能告诉我如何使用tablevIEw&控制器?
我确实经历了几个文档和示例,但实际上无法理解
解决方法 您需要指定表视图的行和节数.像这样.- (NSInteger)numberOfSectionsIntableVIEw:(UItableVIEw *)tableVIEw { #warning Potentially incomplete method implementation. // Return the number of sections. return 1; } - (NSInteger)tableVIEw:(UItableVIEw *)tableVIEw numberOfRowsInSection:(NSInteger)section { #warning Incomplete method implementation. // Return the number of rows in the section. return [sourceData Count]//i.e.,10; } - (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; } 总结 以上是内存溢出为你收集整理的ios – UITableView&Controller为我提供了空表视图全部内容,希望文章能够帮你解决ios – UITableView&Controller为我提供了空表视图所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)