views:

27

answers:

1

Hi,

I'm developing an app with SDK 3.1.2 and it runs in the simulator, but when I try to deploy it in the device it arise de following error:

2010-06-17 17:40:39.592 MyApp[2143:207] *** -[__NSCFDate dateInformation]: unrecognized selector sent to instance 0x21e6a0
2010-06-17 17:40:39.608 MyApp[2143:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFDate dateInformation]: 

Why this doesn't happen for the simulator?

Thanks in advanced for your help.

+2  A: 

There's no method in either Cocoa or Cocoa Touch called dateInformation. So it sounds like you've got one of the following:

  1. A category on NSDate that provides dateInformation, but isn't being compiled into your device builds (Possible, but unlikely)
  2. A method on some other object that's not an NSDate but does have a dateInformation method. However, if your other object gets deallocated, it's possible that the memory formerly occupied by the object could be recycled for use with an NSDate. (much more likely) You can debug this by running with NSZombieEnabled set to YES in your program environment (or use the Zombies instrument).
Dave DeLong
But there is no place in my code that I called a method with that name. Why this doesn't happen in the simulator? Shouldn't be the same?
Rafael
@Rafael no, the differences between the simulator and the device are well documented elsewhere. From the Run menu in Xcode, choose "Stop on Objective-C Exceptions" and re-run. When it hits that error, it'll stop and you'll be able to see where the error is originating.
Dave DeLong
@dave thank you very much for you help. It happened to be the case 1. I was using a library that implemented dateInformation... It wasn't building properly in the device because I forgot to add a flag in the build that was required by the library... The only thing I don't understand is why this didn't cause a problem for the simulator... I need to learn more about it...
Rafael