iPhone app running in Instruments fails with unrecognized selector

Posted by Mark Smith on Stack Overflow See other posts from Stack Overflow or by Mark Smith
Published on 2009-08-13T17:27:59Z Indexed on 2010/03/29 20:03 UTC
Read the original article Hit count: 469

Filed under:
|
|

I have an app that appears to run without problems in normal use. The Clang Static Analyzer reports no problems either. When I try to run it in Instruments, it fails with an unrecognized selector exception.

The offending line is a simple property setter of the form:

self.bar = baz;

To figure out what's going on, I added an NSLog() call immediately above it:

NSLog(@"class = %@ responds = %d", [self class], [self respondsToSelector:@selector(setBar:)]);
self.bar = baz;

On the emulator (without Instruments) and on a device, this shows exactly what I'd expect:

class = Foo responds = 1

When running under Instruments, I get:

class = Foo responds = 0

I'm stumped as to what could cause this. Perhaps a different memory location is getting tromped on when it's in the Instruments environment? Can anyone suggest how I might debug this?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c