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:
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.
[__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!
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.
Maybe it's the project settings
Try to add -ObjC
Related
I have a date picker in my app and it was working fine up until I updated to the latest Xcode.
Now when I use it it crashes and gives this error.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIDatePickerMacCompactView _setTextColor:]: unrecognized selector sent to instance 0x11135ae50'
This is an app that is on iOS and Mac OS using catalyst.
The date picker works fine on the iOS devices but crashed like this on the Mac version.
Has anyone got any idea on what may be happening, I cannot find the UIDatePickerMacCompactView in there files anywhere.
Just by reading the error message, are you setting the text color as UIColor instead of NSColor by chance. I have little experience with Catalyst so I might be wrong but that's my 2 cents.
I am getting this Error :
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MasterViewController setRefreshControl:]: unrecognized selector sent to instance 0x2681e0'
How to resolve this issue because in simulator my app is running but on device with the same code my app is not running.
I hope your simulator is iOS6 Simulator and the device in which you tried to run may have a lower OS version ..right?
.
From UIRefreshControl Class Reference,
Availability : Available in iOS 6.0 and later.
Refresh control is new to iOS6. So if you want to support iOS5, the best thing to do is check if the refresh control class exists (you can use NSClassFromString ), and if it doesn't exists either not use it or use an alternative.
I'm implementing ShareKit, and so far so good on iOS5.1 and 6.0, however 5.0 is giving me a bit of problems in the simulator.
Whenever I execute my actionsheet and leave the program (for example to launch Facebook in browser), my app will crash with:
-[CFXPreferencesSearchListSource tryLock]: unrecognized selector sent to instance 0x957e120
What is going on? Couldn't find any similar errors out there when searching. Thanks
It's a bug of simulator 5. After UIAlertView dismissed, press CMD+SHIFT+H, the bug occurs.
In fact, it doesn't occur in physical devices. So don't panic
i am using EkSource class from Eventkit framework for creating custum calender but , when i am running application in ios 4.3.3. i am getting following error :-
2012-04-03 14:49:36.522 TimeFix[791:707] -[EKEventStore sources]:
unrecognized selector sent to instance 0x252a00 2012-04-03
14:49:36.590 TimeFix[791:707] *
Terminating app due to uncaught
exception 'NSInvalidArgumentException', reason: '-[EKEventStore
sources]: unrecognized selector sent to instance 0x252a00'
but when i am using ios 5.0 ipod for run application, is working fine with custom calender.
so please suggest me what is the is problem with ios 4.3.3.
Your error shows that you might have used something like this
[EKEventStore sources]
Am I right? If yes,
then apple doc says
sources
Returns an unordered array of source objects.
(NSArray *)sources
Return Value An unordered array of EKSource objects.
Availability Available in iOS 5.0 and later. Declared In
EKEventStore.h
So it is available in iOS 5.0 & later.
I'm referencing two static libraries. I build them in debug-simulator mode and all works well with my app. I then create debug-iphone builds and push my app to the device. It breaks with this error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString sizeWithCGFont:pointSize:constrainedToSize:]: unrecognized selector sent to instance 0x24320'
Then the SIGABRT error shows.
Why would this work fine on the simulator and only manifest on the device?
-- EDIT --
Finally figured out a work around, at least for running on the device but now not the simulator. The method that is throwing the exception is a class I'm using for fonts. It is part of staticLibA, for example, which is the library that was having issues. I included staticLibA as a reference in the target app and also the .m file of the problem class. I already had a reference to its header file, which is a category in NSString. Is that why it didn't work until I included the .m file?
If I try to run it in the simulator, I get a duplicate object error in the build output folder for the above class.
I couldn't tell you why your issue is only presenting itself on the device at the moment - perhaps you need to clean both builds and try recompiling them?
In any case, the exception message shown is completely valid. There is no (public) method named -[NSString sizeWithCGFont:pointSize:constrainedToSize:]. Are you trying to call one of the sizeWithFont: methods on NSString anywhere?
Edit: Looks like the sizeWithCGFont:pointSize:constrainedToSize: is from cocos-2d, which I'm guessing would be one of your static libraries. The major significant different between simulator and device builds is the build architecture - the simulator's architecture is the architecture of your own machine (i386), while device builds are for armv6 or armv7. Are you sure your static libraries are built for the right architectures?
Simulator builds are compiled for the Intel platform since your computer is on the x86 (or x86_64) architecture.
The device builds compile to the arm6 (or arm7) architecture.
You can't use a library that's been compiled for one on the other. The assembly code from each isn't compatible.
I have had this problem show up when I was releasing an object incorrectly. So I would have a pointer to a unallocated object. So when I called a function on the object, it would say that I was calling the function on a NSCFString object. Probably because the memory was reused for a NSString object. I fixed it by finding my extra release and removing it.