I\'m still new to blocks in objective-c and wondering if I have this psuedo code correct. I\'m not sure if it\'s enough to just remove the observer or if i have to call removeOb
The scope of the block doesn't have permission to release the scanner object. If you're not using garbage collection, removing the release
and making the scanner autorelease ([[[Scanner alloc] init] autorelease]
) should do the trick.
You should also be able to safely move the call to removeObserver
outside of the block.
For the case of EXC_BAD_ACCESS
: Entering bt
in the console window after the application crashes will give you a backtrace, and should inform you where the error occurred.