appdelegate

pausing spritekit game using appdelegate in ios8

ε祈祈猫儿з 提交于 2019-12-04 20:53:10
I have a pause menu in my game that I want to toggle when the i hit my home button. it works when I'm within my game, however when I hit my home button the menu comes up, but the game will not pause. when i restart the app, the menu is still there, but the game un-pauses itself. It seems like spritekit automatically pauses and restarts the game on its own when you leave and enter the app. When I'm within the app I have full control over it. But when I'm exiting/entering the app it behaves how it likes. Any suggestions? func applicationWillResignActive(application: UIApplication!) { // get the

Core Data NSManagedObject doesn't have a valid NSEntityDescription

坚强是说给别人听的谎言 提交于 2019-12-04 20:51:43
I am trying to set up core data with my Xcode project and running into an error that I can't seem to get rid of. I have an entity called UserDetails inside of StudyHub.xcdatamodeld . My code in the AppDelegate: // MARK: - Core Data stack lazy var persistentContainer: NSPersistentContainer = { /* The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ let container =

Passing data back and forth using AppDelegate

烈酒焚心 提交于 2019-12-04 20:45:32
To start I am building an app to learn the basics of Objective-C. If there is anything unclear please let me know and I will edit my question. The app is supposed to have the next functionality. Open the camera preview when the app is executed. On the top there is a button to go to a TemplateController where the user can select an array of frames to select from a UICollectionView. User selects the Template and returns to the Camera Preview. User takes a picture and the picture with the frame selected is shown in the PreviewController. If the user doesn't like the frame and wants to switch it

Configure deep links in swift?

烈酒焚心 提交于 2019-12-04 09:15:16
So I have an app written in swift that I would like to use deep links for. A user would click on one that in the route of the URL had different pieces of information such as the id of the post or the number of likes it has or something like that. I understand that you put this in the AppDelegate: func application(application: UIApplication,openURL url: NSURL,sourceApplication sourceApplication: String?,annotation annotation: AnyObject?) -> Bool { println(url.host as String!) return true } And that prints everything after appname:// . But how can I get url.host to my view controller to be

Can I use PushKit to do regular push with out using VoIP? Will it allow killed app to be launched in background if user does not act on notification?

人盡茶涼 提交于 2019-12-03 23:10:58
In the PushKit it is mentioned we can use regular push or VoIP push. But I did not find any documentation for what PKPushType to use for regular push. Did anybody try the regular push using the PushKit? If I don't use VoIP is it possible for a killed app to be launched in the background if it receives push notification? Meaning if app is killed and a notification comes and user does not act on it, can the app be launched by iOS in the background if I use PushKit? Since iOS 13.0, this is NOT allowed anymore. Apple will kill the app if failing to present CallKit before the didReceiveIncomingPush

Access a view controller from appdelegate using storyboard

 ̄綄美尐妖づ 提交于 2019-12-03 20:25:47
I have followed this Ray Wendelich Tutorial RayWenderlichTutorial Tabbarcontroller using storyboards Just see the storyboard image. Ray is accesing 'playersViewcontroller using the below code' UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UINavigationController *navigationController = [tabBarController viewControllers][0]; PlayersViewController *playersViewController = [navigationController viewControllers][0]; When I'm trying to access playerDetailsViewController, using the following code i get a crash. Giving the message Ratings[2630:60b] *

Why I am getting Lazy loading NSBundle MobileCoreServices.framework?

六眼飞鱼酱① 提交于 2019-12-03 15:41:27
问题 When I redirect from main viewController to another viewController I'm getting this Error: Lazy loading NSBundle MobileCoreServices.framework, Loaded MobileCoreServices.framework, System group container for systemgroup.com.apple.configurationprofiles path is /Users/develop/Library/Developer/CoreSimulator/Devices/083C0102-C85F-463A-96F4-CA1B9AC7919D/data/Containers/Shared/SystemGroup/ systemgroup.com.apple.configurationprofiles My code is... Appdelegate.m if (![[NSUserDefaults

Push notification data not getting when app launched directly by clicking app icon

拥有回忆 提交于 2019-12-03 12:37:15
I have a scenario in which app will get push notification and need to show that messages in home screen of my app, for that i saved the message array into user defaults from my app delegate and everything works well, but in following conditions it's not working if app is in killed state and a notification came and user triggeres the app through the app icon (not from push notification ) if app is in background and notification came and user enters to app through app icon (not from push message ) in this case also Then i searched for solutions and came to know about silent push notifications

Replace xib file with Main.storyboard file in App delegate class

北城以北 提交于 2019-12-03 11:08:57
问题 Right now project is using MainWindow.xib in App delegate class as main nib file. It has this code in main.m file int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, nil); [pool release]; return retVal; } I want to replace it with Mainstoryboard. I changed it in the info.plist file as Mainstoryboard file base name but it shows error that there is no app delegate set. An app delegate class must be

Swift 4 ,must be used from main thread only warning

落爺英雄遲暮 提交于 2019-12-03 10:40:49
问题 When I using Swift4 in Xcode 9 gives me UIApplication.delegate must be used from main thread only .... must be used from main thread only UI API called from background thread Group Purple Warning. My codes; var appDelegate = UIApplication.shared.delegate as! AppDelegate public var context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext let prefs:UserDefaults = UserDefaults.standard var deviceUUID = UIDevice.current.identifierForVendor!.uuidString Warning line