【发布时间】:2012-04-29 09:04:53
【问题描述】:
我现在正在使用 UITableView,我拥有的是
MyClass.h
@interface MyClass : UIViewController {
}
@property (strong , strong) UILabel *name;
@property (strong , strong) UILabel *add;
和
MyClass.m
-(NSInteger)tableView:(UITableView *)atableView numberOfRowsInSection:(NSInteger)section{
return 3 ; }-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"cell"; tableCell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier]; ................................................... return tableCell;}
当我在 numberOfRowsInSection 处设置断点时,它似乎根本没有被执行。 现在让我很困惑。 有遇到过的请指教。
谢谢
【问题讨论】:
-
请在发布前修改您的代码。你的
@property放错地方了。您用点省略的代码对显示的内容起着重要作用。 -
我刚刚编辑了...我只想确保 numberOfRowsInSection 是否正在执行的第一件事。否则,显示什么都不是……
标签: iphone objective-c ios cocoa-touch