I ran into one problem regarding one module so that I could clear the thread for the same one.
I have one configured UITableviewCell.
When I receive new information, I send one notification
[[NSNotificationCenter defaultCenter] postNotificationName:KGotSomething object:nil userInfo:message];
In the field of view where I maintain the table, I launch the customized cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
cell= [[CustomCell alloc] initWithFrame: reuseIdentifier:identifier document:doc];
return cell;
}
now at customcell.mm
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(GotSomething:)
name:KGotSomething
object:nil];
}
and at dealloc
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self
name:KGotSomething
object:nil];
}
Now my application crashes due to this notification and dealloc is never called.
Can you guys help me how to get this job or something that I am doing wrong here?
Thank,
Sagar
source
share