Update: problem magically disappeared, see comment
I have a function which works fine on an iPhone 3G, iPhone 3Gs and simulator but crashes on an iPod touch 2nd generation.
- (id) initWithDelegate:(id) delegate
data:(NSData *) data
finishSelector:(SEL)finishSelector{
if(self = [super init]){
_delegate = delegate;
_finishSelector = finishSelector; // crashes
When it reaches the last line it crashes with “EXC_BAD_ACCESS”. When I put a breakpoint on that line and hover over finishSelector, I see this:
When I hover over _finishSelector I see this:
When I try "Print Description", the console returns:
Printing description of finishSelector:
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context to what it was before the call.
The function is called like so:
_teachersWordPlayer = [[SimplifiedPlayer alloc] initWithDelegate:self
data:_audioFileService.responce
finishSelector:@selector(teachersAudioPlayerDidPlay:)];
Part of the header file looks like this:
@interface SimplifiedPlayer : NSObject <AVAudioPlayerDelegate> {
AVAudioPlayer *_soundPlayer;
id _delegate;
SEL _finishSelector;
}
- (id) initWithDelegate:(id) delegate
data:(NSData *) data
finishSelector:(SEL)finishSelector;
I also tried to enable NSZombie, but it doesn't provide any more details about the crash (I don't expect it to, because I never released _finishedSelector afaik).
Can anyone tell me what's going on, how to fix this and/or how to find out what's going on?