我面临一个关于一个模块的问题,让我清除相同的流程。由于PostNotification导致的EXC_BAD_ACCESS
我有一个自定义的UITableviewCell。
当我得到我张贴一个通知
[[NSNotificationCenter defaultCenter] postNotificationName:KGotSomething object:nil userInfo:message];
鉴于我在哪里维护表我发起定制的电池
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
cell= [[CustomCell alloc] initWithFrame: reuseIdentifier:identifier document:doc];
return cell;
}
现在customcell.mm
一些新的信息- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(GotSomething:)
name:KGotSomething
object:nil];
}
and dealloc
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self
name:KGotSomething
object:nil];
}
现在我的应用程序崩溃,由于此通知和dealloc永远不会被调用。
你们能帮助我,怎么得到这个工作什么的我米做错了在这里...
感谢,
萨加尔
你可以检查GotSomething:的customcell,是否在这里?方法签名是否正确? – vodkhang 2010-06-15 09:14:49