I have a number of UIViews coming into view, then going out of view and being unused. However, I believe some of them are still receiving notifications even after they are gone wich is causing problems.
On the UIView "parent" container:
if(self._content != nil && [self._content respondsToSelector:@selector(presentMe:)]) {
[self._content presentMe:NO];
}
On the UIView "child":
[[NSNotificationCenter defaultCenter] <-- EXC_BAD_ACCESS (code=1, address=0x70000008
postNotificationName:PRESENTING
object:self
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:prepareToEnter], PRESENTING, nil]];
Everything works the first time around, but if I launch the same view a second time I get an EXC_BAD_ACCESS. Doesn't that mean something is missing?
FYI this is all in ARC - xcode 4.3.2
If you are calling addObserver
for items in your view, you need to call removeObserver
during dealloc. Even with ARC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With