【发布时间】:2014-08-05 09:45:21
【问题描述】:
当调整包含UITableView的UIView的位置时,会调用以下tableview数据源方法:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath
但是当这个方法被调用时:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
static NSString *CellIdentifier = @"Cell";
CommentCell *cell = [[CommentCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
NSDictionary *dic = self._tableViewData[indexPath.row];
[cell setComment:[dic objectForKey:@"text"]];
[cell setTimeString:[self commentTimeTransfer:[dic objectForKey:@"create_at" ]]];
[cell setNickName:[dic objectForKey:@"nick"]];
NSString * avatarString = [dic objectForKey:@"avatar"];
NSRange rang = [avatarString rangeOfString:kYoupaiyunURL];
avatarString = [avatarString substringFromIndex:rang.location + rang.length];
NSString * urlString = [commonTool fangdaolianUPY:[NSString stringWithFormat:@"/%@",avatarString]];
urlString = [NSString stringWithFormat:@"%@?_upt=%@",[dic objectForKey:@"avatar"],urlString];
[cell setImageURLString:[NSString stringWithFormat:@"%@",urlString]];
[cell _initViews];
if (([self._tableViewData count]-1) == indexPath.row) {
self.lastCommentTime = [[dic objectForKey:@"create_at"] intValue];
}
return cell;
}
应用程序崩溃。我确信这些方法没有问题,但我不知道是什么原因造成的。我需要一些有关可能导致此问题的指导。
【问题讨论】:
-
控制台上打印的崩溃是什么?
-
请发布更多崩溃日志详细信息,以便我们了解实际问题。
-
你应该返回所有代表方法...提供你做了什么
-
可以分享
-tableView:cellForRowAtIndexPath:的实现吗? -
控制台打印:“libc++abi.dylib:terminate_handler 意外抛出异常”。
标签: ios objective-c uitableview