This is an error that my friend is getting when testing my app, but I can’t reproduce it. I’ll start with code:
TransferFrequency.h
@interface TransferFrequency : NSObject
- (BOOL)isImmediate;
// Other details...
@end
TransferFrequency.m
@implementation TransferFrequency
// Other details...
- (BOOL)isImmediate
{
return YES;
}
@end
Transfer.h
@interface Transfer : NSObject
@property (nonatomic, retain) TransferFrequency* frequency;
// Other details...
@end
Transfer.m
@implementation Transfer
@synthesize frequency;
// Other details...
@end
CreateTransferView.h
@interface CreateTransferView : UITableViewController
@property (nonatomic, retain) Transfer* transfer;
// Other details...
@end
CreateTransferView.m
@implementation CreateTransferView
@synthesize transfer;
// Other details...
- (void)confirmButtonTouched
{
// The crash happens on the following line, as confirmed by stack trace
if([self.transfer.frequency isImmediate])
// Do some stuff
}
@end
When the user touches the confirm button, confirmButtonTouched is called. This is the error my friend is getting:
-[TransferFrequency isImmediate]: unrecognized selector sent to instance 0xeec6db0
It appears to me that the selector isImmediate is being called on a legitimate TransferFrequency object, but the iPhone is saying it can’t find that selector.
There are actually several iPhones that are reporting this error to me but I do not have physical access to any of them, so I’m stuck debugging from afar. My own iPod touch, iPhone, and iPhone Emulator all work just fine.
Any ideas as to what may be causing this?
Well, sorry to waste everybody’s time. My friend is distributing the app for testing from his own machine. It turns out that he needed to clean and rebuild the project. Works great now.
Anyway, thanks for the help, everyone. And the lesson here is that if you’re having a problem that doesn’t really make sense, clean and rebuild!