appdelegate

Can't declare another window

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 04:36:40
问题 I'm trying to declare another window in MyThing.m @property (nonatomic, strong) UIWindow *window; But get this error Illegal redeclaration of property in class extension "MyThing" (attribute must be 'readwrite', while its primary must be 'readonly') If I rename window to something else, it is OK. Why is that? Is window meant to be declared once in the AppDelegate.h ? 回答1: I figure out the problem, it has nothing to do with the window property declared in AppDelegate.h The problem is MyThing

AppDelegate didFinishLaunchingWithOptions launchOptions - terminating with uncaught exception of type NSException Swift 3.0

邮差的信 提交于 2019-12-12 04:28:18
问题 I'm trying to create login/protected page session page using Swift 3.0 Therefore, I created didFinishLaunchingWithOptions launchOptions function in AppDelegate.swift as below AppDelegate.swift import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application

Landscape orientation View Controller App Delegate

a 夏天 提交于 2019-12-11 19:24:10
问题 I'm trying to put only a View Controller in Landscape mode and the other ones in Portrait mode. First of all, I've tried to invalidate the rotation of each View Controller except for the one I want (With shouldAutoRotate false, only Portrait, ...), but with a Navigation Controller I have, it overlaps the Nav bar with the Status Bar, and I couldn't solve it. So after that, I've tried to clean everything I've done and enable or disable the Orientation ONLY from the AppDelegate. So here's a code

How do I move these processes from the AppDelegate and set up individual delegates from each Call?

随声附和 提交于 2019-12-11 18:37:06
问题 I know this is not best practice so I would like to know what's the best way to remove all these requests to individual delegates as to reduce loading time. The result is to have each feed load as soon as it is called or have them load asynchronously - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { // Override point for customization after application launch. // make RSS call JSTRRSSReader *reader = [[JSTRRSSReader alloc] init];

Table not loading data after adding SWRevealViewController

别来无恙 提交于 2019-12-11 18:06:27
问题 After a bit of bungling I have added a reveal view controller to my app but now it doesn't seem to be loading the data. I can't see where my changes would have affected that aspect of the app. in didFinishLaunchingWithOptions I changed STRTableViewController *tableViewController = [(UINavigationController *)self.window.rootViewController viewControllers][0]; self.delegate = tableViewController; to the following since the rootViewController is no longer the table view: // in .m interface

Delegate text from TextField between Container Views

别说谁变了你拦得住时间么 提交于 2019-12-11 16:04:25
问题 I'm trying to pass text form one TextField to another TextField. Both of them are located in different ContainerViews. Users can switch between different ContainerViews by Segmented Control (thus, all my ContainerView are located inside of the ViewController with Segmented Control). I tried to do this with delegation: whenever text in TextFieldOne change, this changing should affect on another textField, so, I tried to use action on TextField in first container with Event "Value Changed":

UIPasteboard returns nil in the background

久未见 提交于 2019-12-11 15:57:10
问题 I am trying to read the Pasteboard for 5 times in the applicatioDidEnterBackground section of the AppDelegate. To print the string I use print(UIPasteboard.general.string!) but it works only into the function and it doesn't in the other nested functions. Let me explain: func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application

AppDelegate Never Gets Its didReceiveRemoteNotification Called For CKQuerySubscription

人盡茶涼 提交于 2019-12-11 15:18:30
问题 I'm trying to let the iOS app listen to CKQuerySubscription changes. Data is transmitted by a remote iOS app. I already have a macOS application, which does receive data sent by the remote iOS app. The iOS app I have trouble with already has a subscription. Yet, its AppDelegate never receives a call in the didReceiveRemoteNotification method. import UIKit import UserNotifications import CloudKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate,

How to use MRCountryPickerDelegate

不想你离开。 提交于 2019-12-11 15:01:41
问题 I am trying to implement MRCountryPicker for selecting Country Flag and Code.I have installed pods. now i have no idea how can i get delegate method or how can i declare like this "MRCountryPickerDelegate" for more detail check out https://github.com/xtrinch/MRCountryPicker class ViewController: UIViewController, MRCountryPickerDelegate { i am getting this error Thanks for your appreciation's and help..Thank you. 回答1: If I understand your question properly, First you must "import

Accessing push payload if app is inactive

陌路散爱 提交于 2019-12-11 13:21:55
问题 I have a push notification, and when app receives it, I call the following func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) { if userInfo["t"] as! String == "rqst" { print("type is help request") if let token = NSUserDefaults.standardUserDefaults().objectForKey("authToken") { authTokenOfHelper = token as! String } let storyBoard = UIStoryboard.init(name: "Main", bundle: nil) let viewController = storyBoard