I used xcode 9.4 with swift 3 the code is working fine and its was in live. Now when i run my same code in xcode 10.1 i am getting many segmentation fault 11
error for many files.Not sure how can i do that.And how can i conver my swift 3 to swift 4. Bec many files i needs to change syntax.
Better i needs to use swift 3 in xcode 10.1 and needs to resolve that segmentation fault 11
.
Major error i got in here :
- While emitting SIL for 'application(_:didReceiveRemoteNotification:)' at /Users/Documents/Rough/jeder/JEDE_r/AppDelegate.swift:258:5
- While silgen emitFunction SIL function "@$S3WCi11AppDelegateC11application_28didReceiveRemoteNotificationySo13UIApplicationC_SDys11AnyHashableVypGtF". for 'application(_:didReceiveRemoteNotification:)' at /Users/Documents/Rough/jeder/JEDE_r/AppDelegate.swift:258:5 error: Segmentation fault: 11
My code :
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any])
{
if application.applicationState == .inactive || application.applicationState == .background {
//opened from a push notification when the app was on background
}
else
{
if application.applicationState == .active
{
let myuserinfo = userInfo as NSDictionary
print(myuserinfo)
let tempDict:NSDictionary = (myuserinfo.value(forKey: "aps") as? NSDictionary)!
let alert = UIAlertView(title: "alertView", message: (tempDict.value(forKey: "alert") as? String)!, delegate: nil, cancelButtonTitle:"Cancel", otherButtonTitles: "Done", "Delete")
alert.show()
let person:NSDictionary = (tempDict.value(forKey: "custom") as? NSDictionary!)!
}
}
}
Whats the issues here. How can i get solve all the segmentation fault 11
error nearly 22 files its showing that error.
Any help on that please !!