我有一个customTableView单元格 - 我想只更新单元格(基于发生的网络事件).
所以,当我第一次拨打网络电话时,我做了:
- (void)makeNetworkCall
{
[self.tableView beginUpdates];
// MAKE_NETWORK_CALL
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationNone];
[self.tableView endUpdates]; // SIGABRT OCCURS HERE ON SECOND CALL
}
- (void)networkDataReturned:(NSDictionary*)dataReturned
{
// UPDATE_TABLE_VIEW_DATA_MODEL
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationNone];
}
Run Code Online (Sandbox Code Playgroud)
这在第一次调用网络事件时完美地工作,但是如果单元被轻击(因此再次调用网络事件,其结果现在已被缓存),我得到以下错误:
2011-06-22 11:19:11.262 App[3991:707] *** Assertion failure in -[_UITableViewUpdateSupport _setupAnimationsForExistingVisibleCells], /SourceCache/UIKit/UIKit-1448.89/UITableViewSupport.m:288
2011-06-22 11:19:11.327 App[3991:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempt to create two animations for cell'
*** Call stack at first throw:
(
0 CoreFoundation 0x32c7664f __exceptionPreprocess + 114
1 libobjc.A.dylib …Run Code Online (Sandbox Code Playgroud) 有人为Facebook/Twitter/Email创建了UIBarButtonItem的图标吗?
谢谢
我有一个UITableView单元 - 我从网络中提取信息,我有以下委托方法:
-(void)dataReturned:(NSString*)data indexPath:(NSIndexPath*)indexPath
{
MyTableViewCell *currentCell = (MyTableViewCell*)[self tableView:self.tableView cellForRowAtIndexPath:indexPath];
currentCell.someInfo.text = data;
currentCell.smallActivityIndicator.hidden = YES;
}
Run Code Online (Sandbox Code Playgroud)
但遗憾的是,"someInfo"和smallActivityIndicator似乎都没有更新.
关于我做错了什么的任何建议?
谢谢!