-3
-[UIDevice imei]: unrecognized selector sent to instance 0x1f566990

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '-[UIDevice imei]: unrecognized selector sent to instance 0x1f566990'

*** First throw call stack:
(0x376962a3 0x359a697f 0x37699e07 0x37698531 0x375eff68 0xb7465 0x38986595 0x389db13b
0x389db081 0x389daf65 0x389dae89 0x389da5c9 0x389da4b1 0x389c8b93 0x389c8833 0xb34fd 
0x38a520ad 0x38a5205f 0x38a5203d 0x38a518f3 0x38a51de9 0x3897a5f9 0x38967809 0x38967123 
0x37b1a5a3 0x37b1a1d3 0x3766b173 0x3766b117 0x37669f99 0x375dcebd 0x375dcd49 0x37b192eb 
0x389bb301 0xb38d3 0xb3028)

libc++abi.dylib: terminate called throwing an exception

Myxcode version 4.6.2 please help.

Simon
  • 25,468
  • 44
  • 152
  • 266
AppDeveloperIOS
  • 107
  • 1
  • 1
  • 6
  • 2
    What do you think that method is? I don't see it in the [docs](http://developer.apple.com/library/ios/#documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html)... – geraldWilliam May 16 '13 at 06:35
  • 1
    Maybe this can help you https://github.com/erica/uidevice-extension/blob/master/UIDevice-IOKitExtensions.m – Edelweiss May 16 '13 at 06:40
  • check this http://stackoverflow.com/questions/2453415/imei-number-using-iphone-code – Sugan S May 16 '13 at 06:46
  • Thanks for the response,Yes i am using Erica Sadun's code. Now it called but I am getting one compile time error below line CFTypeRef prop = IORegistryEntrySearchCFProperty(entry, kIODeviceTreePlane, (CFStringRef) iosearch, nil, kIORegistryIterateRecursively); Error:Cast of objective-c pointer type "NSString *" to "CFStringRef"(aka 'ons struct_CFString *') requirers a bridged cast. – AppDeveloperIOS May 16 '13 at 09:01

1 Answers1

1

There's no method called imei on the UIDevice class as provided by Apple, so when you try to call it you get a crash.

That said, there is such a method in Erica Sadun's UIDevice extensions - perhaps you're reusing code that assumes that they're present - so if you add them to your project then your code should work as you expect.

Simon
  • 25,468
  • 44
  • 152
  • 266