Here is my code below. I keep getting the error: "Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior". Everywhere online says this code will work. Thoughts on why it doesn't work? let alert = UIAlertController(title: "Alert: iCloud Disabled", message: "Go into Settings -> iCloud -> iCloud Drive and switch iCloud Drive to On.", preferredStyle: UIAlertControllerStyle.Alert) let OKAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (_)in self.networkAlertDisplayed = true self.performSegueWithIdentifier("unwindToController1", sender: self) }) alert.addAction(OKAction) self.presentViewController(alert, animated: true, completion: nil)What do I need to do to get this code working?
Post not yet marked as solved
How come my CKModifyRecordsOperation always returns with an error now? This API call has worked for many years. What has changed?let modifyOperation : CKModifyRecordsOperation = CKModifyRecordsOperation(recordsToSave: [testRecord], recordIDsToDelete:nil) modifyOperation.savePolicy = CKRecordSavePolicy.allKeys modifyOperation.database = CKContainer.default().privateCloudDatabase modifyOperation.modifyRecordsCompletionBlock = { savedRecords, deletedRecordIDs, error in if (error == nil) { } else { //Always ends up here now } } OperationQueue.main.addOperation(modifyOperation)
Post not yet marked as solved
When I push a UIBarButton in my app the app breaks at:class AppDelegate: UIResponder, UIApplicationDelegate {with the error saying:2017-10-07 18:22:12.033188-0400 App Name[3285:927126] -[ tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x131e5df802017-10-07 18:22:12.034135-0400 App Name[3285:927126] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x131e5df80'Before I took the Xcode 9 update everything was working fine. Does anyone know what could be causing this code to break?
Post not yet marked as solved
When I select a UIBarButton to go to the next screen, the app crashes on:class AppDelegate: UIResponder, UIApplicationDelegate {with the error:2017-10-07 18:22:12.033188-0400 AppName[3285:927126] -[tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x131e5df802017-10-07 18:22:12.034135-0400 AppName[3285:927126] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x131e5df80'Everything was working fine before the xcode update and change to Swift 4. Any suggestions on what is causing this for me?
If I have a running NSTimer and I want to navigate to a different screen, is there a way I can keep my NSTimer running from the original screen even when in the different screen?