I am trying to figure out why my addObserver call in my app is causing an EXC_BAD_ACCESS when its selector should be called. Let me explain some more, I do my addObserver call in a method that invokes the MFMessageComposeView and then I add an observer for the "didFinish" notification in the 3rd party library, ShareKit. Now whenever the addObserver's selector should be called, a EXC_BAD_ACCESS is raised. Also my addObserver is in a NSObject class if that makes any difference.
This is the code I use for the addObserver:
NSString *moredetailedshareText = [NSString stringWithFormat:@"Hey"];
[SHKTextMessage shareText:moredetailedshareText];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(SHKSharerFinished:) name:@"SHKFinishedCall" object:nil];
This is the postNotification call in ShareKit:
- (void)sharerFinishedSending:(SHKSharer *)sharer
{
NSLog(@"finishedsending");
[[NSNotificationCenter defaultCenter] postNotificationName:@"SHKFinishedCall" object:sharer];
if (!sharer.quiet)
[[SHKActivityIndicator currentIndicator] displayCompleted:SHKLocalizedString(@"Saved!")];
}
What would be the cause of this to not work?
Thanks!