UNNotificationCenter issue crash the app - objective-c

When I run my App on ios10 or later, the app works fine but the problem is that when I run the app on ios9 it crashes. I put deployment target 9.0 or later ,I could not find why it is not working on ios 9 and the warning shows like this :
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '+[NSString
localizedUserNotificationStringForKey:arguments:]: unrecognized
selector sent to class 0x10d042b00'

The problem is with method: localizedUserNotificationStringForKey:arguments.
Please note that this method is only available from iOS 10+.
This method you are using comes in UserNotifications framework. This framework introduced in iOS 10. That's why it's not supporting iOS9 devices.
Please refer this document : Apple Doc on UserNotifications Framework

The method you are using localizedUserNotificationstringForKey is available for iOS 10 or later , it’s not for ios9

Related

Exception while running xamarin ios app on devices only. The App runs on simulator perfectly

I am using native ios framework in xamarin ios application. However i am getting an error while runtime. It throws below exception on device at runtime but it works smoothly on simulators.
Name: NSInvalidArgumentException Reason:NSDate consoleOutputTimestamp.
The reason might be, I was using a third-party NSDate category in my naive iOS framework. When I removed the whole NSDate third-party library.
I was able to build it, however it throws a different exception this time. The exception is as below :
Name:NSInvalidArgumentException Reason:UIViewController setIsFullScreen:
Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[UIViewController setIsFullScreen:]: unrecognized selector sent to instance 0x145b3fd0
Means every time I am making changes in native framework, after building it at runtime it throws an exception on devices only.
However the native iOS framework runs on devices in native iOS app smoothly.
However I am getting exception when I build it in Xamarin and runs it in Xamarin App. I have made changes related to architecture in Xamarin while building and in sample app as well but that didn't help. Do i need to make any changes in Xamarin project ?
I am using latest version of visual studio. The app stops at launch time and throws exception.
Please share if you have any idea about this. Thanks in advance.

'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named UIKeyCommand'

My app is crashing when I try to display another view controller. It does work correctly when the iOS SDK is set to 7.0 and I am targeting iOS 7.0. But I need the app to target iOS 6.0. UIKit is (obviously) declared in the imports. The UITableViewController I am trying to present works perfectly fine as far as I'm aware - I created it for another app, using XCode 4.6.3, targeting 6.0 and it compiled without error (as does this one) but it also displays without crashing.
I could provide code, code which does nothing more than present the table view controller using a modal transition, but I even went to the point of connecting a UIButton to the UITableViewController - it worked on iOS 7, but not 6. It's my belief that when I compile with the iOS 6.1 SDK, it should be using iOS 6.1 frameworks?
UIKeyCommand is only available in iOS 7 and later, according to this. That gives me reason to believe that it is using the iOS 7.0 frameworks even though the iOS 6.1 SDK has been specified.
I've tagged this with the xcode tag as I believe it could possibly be caused by xcode incorrectly searching for the specified SDK's frameworks.
I had the same problem as you and here is what i did to solve it:
I opened the Storyboard as Source Code and searched for the tag : keyCommands , I found a tag similar to
<keyCommands> <keyCommand/> </keyCommands>
and i deleted it.
After that i runned the app in iOS 6 & 7 and it worked with no problem.
Let me know if this works on your app too!
Cheers!

App crashes when downloading from appstore

My app running well when running through xcode. After apple submited my app i discovered it crushes on the user's devices. The bug on terminal is:
: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CPTMutableNumericData setDataType:]: unrecognized selector sent to instance 0x21606e90'
I know I use this class in CorePlot-CocoaTouch.h.
1.How can i solve it?
2.Why it is happens only when user download it (Also me, as a user) and not crush when running through xcode?
Thanks
It sounds like you only tested your app using development builds. Before submitting to the app store you want to test the release build using Adhoc deployment. This lets you test the version you will end up sending to Apple.
For now you need to run your app so it crashes on your own device. Then connect the device to your computer with Xcode running. Go to the Organizer window and select the Devices tab. Click on the Device Logs section near the top left corner. After some updating you should see a crash log for your app at the time you just made it crash. Use the crash log to determine where in your app it is crashing.

Revert Xcode 4.5 new XIB files to iOS<6

i've installed Xcode 4.5 with iOS6 SDK and others old SDKs (from 4.3 to 6.0) for testing purpose.
Beautiful, but there is a BIG problem!
A new XIB file is generated for iOS6 compliant!
This is a problem, because my app need to run on older devices, not only 6.0+!
When i load the new view (ios6) in a 5.1 device, it silently crash with this error:
2012-09-24 22:00:17.090 App[14524:11f03] * Terminating app due
to uncaught exception 'NSInvalidUnarchiveOperationException', reason:
'Could not instantiate class named NSLayoutConstraint'
How can i remove extra lines in XIB to make (xib and app) compatible with older ios version?
thanks a lot.
Try changing this option of the xib:
Also make sure that Use Autolayout is off, because it's a iOS 6.0 feature.

Facebook: [FBSession activeSession] crashes app

I am using the Facebook iOS SDK 3.0, and I just upgraded to the new Facebook iPhone app (5.0).
Now, whenever I call [FBSession activeSession], my app crashes with the error:
-[SBJsonParser errorTrace]: unrecognized selector sent to instance 0x499700
This only happens if I have the new Facebook 5.0 app installed. If I deinstall it, and wait for a little bit, my app runs fine. Also, this never happened before with the older version of the Facebook app.
Has anyone run into this before? There seems to be a bug report with the same issue on the Facebook Developer page, but it hasn't been dealt with yet.
This is because of conflict within the SBJson libraries. We're working to get this resolved and should be fix ready .