appdelegate

Refresh NSPersistentStoreCoordinator in AppDelegate from ViewController

戏子无情 提交于 2019-12-13 07:36:05
问题 I have an app where the PersistentStoreCoordinator is set up within AppDelegate. I want to load a new sqlite database from a list of saved sqlite files. I'm happy with deleting the existing Persistent Store and sqlite file and replacing the sqlite file with the one loaded from the table. However, how do I reload/refresh the PersistentStoreCoordinator from the ViewController action of selecting the new file? I've tried setting AppDelegate as a delegate of the ViewController, but this seems to

Local Notification

两盒软妹~` 提交于 2019-12-13 04:12:00
问题 I implemented a local notification in my game app that fires up once a day for a daily bonus. It all works fine when I tap the notification banner, however, when i get in to the app from the app icon, the local notification doesn't work like it should. Here is my code: -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions{ ....... ....... application.applicationIconBadgeNumber = 0; UILocalNotification *localNotif = [launchOptions

Presenting Login View Controller Before the UITabBarController

跟風遠走 提交于 2019-12-13 03:19:21
问题 I want to provide a log on view controller so my users can authenticate prior to being presented the tab bar controller. In the code displayed below, I get the error "Could not cast value of type 'LogInViewController' to 'UITabBarController'. Apple documentation listed: When deploying a tab bar interface, you must install this view as the root of your window. Unlike other view controllers, a tab bar interface should never be installed as a child of another view controller. I am stumped and my

Facebook And Google Login - conflict (Xcode)

亡梦爱人 提交于 2019-12-13 02:32:48
问题 I've read some of the similar questions here, unfortunately, didn't really help me much. I have an Xcode project using Swift, currently, I've integrated Twitter & Facebook login. I would like to have Google login as well. I've followed the steps so far, but I've reach to 2 issues: didFinishLaunchingWithOptions (in AppDelegate.swift). I already have Facebook as a return type, but in Google's documentation it says it requires return true . How to do that? Here's the code: func application

Open ViewModel from Appdelegate

徘徊边缘 提交于 2019-12-13 00:24:05
问题 I am trying to open a specific view in my Xamarin.Ios-Project via a Web-Url. The url-scheme works fine and i also check the url in the AppDelegate class as shown below: [Register("AppDelegate")] public partial class AppDelegate : MvxApplicationDelegate { // other methods ... public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) { if (url == null) return false; var uri = new Uri(url.ToString()); if(uri.Host.Equals("myscheme-host")) {

Change property of AppDelegate from UIViewController is not working

耗尽温柔 提交于 2019-12-12 23:17:21
问题 I run into an issue that inside of AppDelegate , I create a property to share value within the app. @property (nonatomic, retain) User *currentUser; The definition of User object is @property int points; @property (nonatomic, copy) NSString *userName; I have a UIViewController A with a field displaying current user's name. Click on a button will bring up UIViewController B and inside of UIVIewController B, I try to change the values: // I print out these two values here 1 ((AppDelegate*)

UIApplicationLaunchOptionsLocalNotificationKey always null - iOS

核能气质少年 提交于 2019-12-12 19:06:35
问题 I have an iOS application which uses local notifications. When the app is running in the background or is active, I use the application didReceiveLocalNotification methods and that works great. But when the app is closed (not running in the background), I use the application didFinishLaunchingWithOptions method to control what happens when the notification is handled. However, the problem I have is that the notification is always (null) in the didFinishLaunchingWithOptions method. Here is my

Adding UITabBarController and have no NavigationController

那年仲夏 提交于 2019-12-12 10:10:04
问题 As I'm new in Xamarin.IOS, I'd like to ask a question. I've followed this example for adding UITabBarController in a Xamarin.IOS project. When I initialized RootViewController by an instance of TabController, it works fine and I have all tabs. BUT my NavigationController set null ! it means that : NavigationItem will disappear navigating between viewControllers are not possible by this code : this.NavigationController.PushViewController(new ProfileViewController(), true); because the

Not able to set Interactive Push Notifications on iOS8

烂漫一生 提交于 2019-12-12 08:38:36
问题 I was already able to set Interactive LOCAL notifications, but the Remote notifications aren't working. I'm using Parse.com to send the JSON My AppDelegate.Swift looks like this: // // AppDelegate.swift // SwifferApp // // Created by Training on 29/06/14. // Copyright (c) 2014 Training. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions

How can I register user's ios device for receiving push messages from place other than AppDelegate?

为君一笑 提交于 2019-12-12 05:38:23
问题 Currently in my appDelegate in didFinishLaunchingWithOptions I'm calling the following methods: let notificationTypes: UIUserNotificationType = [UIUserNotificationType.alert, UIUserNotificationType.badge, UIUserNotificationType.sound] let pushNotificationSettings = UIUserNotificationSettings(types: notificationTypes, categories: nil) application.registerUserNotificationSettings(pushNotificationSettings) application.registerForRemoteNotifications() I also have the following methods implemented