0

I am testing my music application compatibility on IOS7 by running it on Xcode 5 iPhone simulator(IOS7) but it crashes on retrieving all the music items using following code.

    MPMediaQuery *allSongs = [[MPMediaQuery alloc] init];
    NSArray *itemsFromGenericQuery = [allSongs items]; // Here application crashes

Crash log :

[__NSCFNumber libraryCompletionHandler]: unrecognized selector sent to instance 0xdd66840

This is snapshot for the threads running at the time of crash: enter image description here

I am suspecting that there is some bug in Xcode5..!

EDIT : I could run the same application using Xcode 4.6.3 on simulator/device without any issue/crash.

subhash kumar singh
  • 2,716
  • 8
  • 31
  • 43

3 Answers3

0

[__NSCFNumber libraryCompletionHandler]: unrecognized selector sent to instance 0xdd66840

This error says that an object of type NSNumber was passed the message -libraryCompletionHandler. NSNumber doesn't have a -libraryCompletionHandler method, hence the crash. Obviously, something bad is going on.

Usually this is an indication of a bad cast, or a zombie. In this case, I would suspect a zombie object.

Congratz, you may have found a defect in the iOS 7 Simulator. Woo Hoo!

Jeffery Thomas
  • 42,202
  • 8
  • 92
  • 117
  • I used NSZombieEnabled flag to debug, but still I am getting same crash. I don't think it is because of zombie because I wrote only those two lines on code in viewdidload in my first VC and I got crash. – subhash kumar singh Sep 13 '13 at 13:58
  • @subh.singh Use Zombies in Instruments. Product > Profile, then choose the Trace Template "Zombie". I've had much better luck with that. Again, I don't think it's your code, I think it's Apple's code. – Jeffery Thomas Sep 13 '13 at 14:08
0

I am suspecting that there is some bug in Xcode5..!

There are clearly some bugs in the developer preview versions of Xcode 5, but it sounds like it's your app that's crashing rather than Xcode or the simulator itself. That would lead one to believe that the problem is more likely to be either in your app, or possibly in the operating system.

[__NSCFNumber libraryCompletionHandler]: unrecognized selector sent to instance 0xdd66840

Bad pointers are a common cause of unrecognized selector errors, especially when they involve classes that don't seem to be involved in the code that's crashing. Turn on NSZombieEnabled and set a breakpoint on all exceptions to track down the problem.

Community
  • 1
  • 1
Caleb
  • 124,013
  • 19
  • 183
  • 272
  • I moved my code to the `-viewDidLoad` (of first VC) and I did suggested debug changes, still I am getting same crash. If I run same code in Xcode 4.6.3 it doesn't create any problem. So I think this crash is not because of application ( not because of zombie object ), it is due to Xcode5. – subhash kumar singh Sep 13 '13 at 13:40
0

Maybe it's the project settings Try to add -ObjC

Yitzchak
  • 3,303
  • 3
  • 30
  • 50