uiapplicationdelegate

Continue download in background

↘锁芯ラ 提交于 2019-12-04 10:44:07
问题 I am creating an application wherein I am downloading some data from server. While going in background I want that connection should continue running so that data can be downloaded. I know there is method in appDelegate - (void)applicationDidEnterBackground:(UIApplication *)application which is called when application enters background. But as the connection is created in viewController, how can it be managed in appDelegate ? Also is/are there other way(s) this can be done? I have gone

iPhone application crash on launch

南笙酒味 提交于 2019-12-04 08:36:44
We are receiving a crash log from iTunes connect that is a little strange. We were preivously having problems with our app taking to long to return from ApplicationDidFinishLaunching. This was caused by doing a too much work inside of applicationDidFinishLaunching and we exceeded the 20 second time out on slower devices. To fix this we moved all of our setup code out of ApplicationDidFinishLaunching and moved it into a special secondaryLoadingController. On top of that we moved the setup code inside of that controller to a separate thread. However, we are still seeing crash logs that say our

Is there a way to pass command line options to my iOS app from Xcode?

孤街醉人 提交于 2019-12-04 00:33:51
I'm hoping to find a method to pass certain information in to my app when I launch it during testing, so that I can perform special debug tasks. Xcode has a section "Arguments Passed on Launch", and I assumed they would show up in my UIApplicationDelegate's application:didFinishLaunchingWithOptions: but the dictionary that's passed in is always nil. Am I going about this the wrong way? You can access them using NSProcessInfo object like this, NSArray * arguments = [[NSProcessInfo processInfo] arguments]; Mario Another easier way is to use the NSUserDefaults. http://perspx.com/archives/parsing

Unable to reset brightness on application exit iOS

给你一囗甜甜゛ 提交于 2019-12-03 20:23:39
Why can't I set screen brightness in applicationDidEnterBackground or applicationWillResignActive? This is my code: -(void)applicationDidEnterBackground:(UIApplication *)application { [[UIScreen mainScreen] setBrightness:1.0]; } Can't understand it...!? It works in applicationDidEnterForeground etc, just not when i close the app using the home button. Is there any other solution to this problem? Update August 2016: Brightness changes made by an app remain in effect until the device is locked, regardless of whether the app is closed. The system brightness (which the user can set in Settings or

how to determine in applicationDidBecomeActive whether it is the initial iPhone app launch?

北城以北 提交于 2019-12-03 17:39:11
问题 how to determine in how to determine in UIApplicationDidBecomeActiveNotification whether it is the initial app launch?whether it is the initial app launch? that is the initial start up of the application, as opposed to subsequent DidBecomeActive's due to the application being put in background and then to foreground (e.g. user goes to calendar then back to your app) 回答1: In your applicationDidFinishLaunching:withOptions: put this: [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@

How to get navController from AppDelegate.

爱⌒轻易说出口 提交于 2019-12-03 14:25:21
I am wondering, that how to get navController from AppDelegate = [[UIApplication sharedApplication] delegate] in the iPhone programming. e.g., in other viewController where we reference to the AppDelegate. In the applicationDelegate.h we have: UINavigationController *navController; And the following in applicationDelegate.m - (void)applicationDidFinishLaunching:(UIApplication *)application { [window addSubview: navController.view]; [window makeKeyAndVisible]; } Is there anyway to get the navController from the mainWindow: UIWindow *mainWindow = [appDelegate window]; If this other

Using applicationwillenterforeground for a passcode screen

♀尐吖头ヾ 提交于 2019-12-03 14:23:35
Before iOS4, my app's initial view controller would check a passcode on/off settings variable in viewWillAppear and if set on, present a modal passcode screen that would stay there until the correct passcode was entered or the Home button was pressed. With iOS4, if my app has been in the background, I would like the user to feel comfortable that the data contained within the app is not easily accessible if they were to hand their phone to someone to use. Since the app could return to any screen (the screen that the app was last on), I figured I would use the

Where is your Application Delegate set and who initializes its window and viewController properties?

天大地大妈咪最大 提交于 2019-12-03 10:26:54
I have a very newbie question about IOS apps... If I create a new View Based Application called TestForStackOverflow, Xcode automatically creates code like this for the TestForStackOverflowAppDelegate.h: @class TestForStackOverflowViewController; @interface TestForStackOverflowAppDelegate : NSObject <UIApplicationDelegate> @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet TestForStackOverflowViewController *viewController; @end and the following in TestForStackOverflowAppDelegate.m: #import "TestForStackOverflowAppDelegate.h" #import

present more than one modalview in appdelegate

不问归期 提交于 2019-12-03 07:32:31
I want to present a modalviewcontroller after every push-message the app recieves in "application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo" I present the viewcontroller like this: ReleaseViewController *viewController = [[ReleaseViewController alloc] init]; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController]; [self.window.rootViewController presentModalViewController:navController animated:YES]; So when another push-message arrives and the old ModalViewController is still visibile, I want

How do I access my Application Delegate's window accessor method from another object?

余生颓废 提交于 2019-12-03 07:30:52
问题 As mentioned before - I'm an Objective-C newbie of the first order but having read 4 physical books on the subject and a bucket-load of ebooks and documentation I still can't find what I'm looking for. I have a top-level content view controller that wants to configure its view property from the physical dimensions of the window property of the application delegate. This is something that several people have already asked questions on. ( [UIScreen mainScreen] doesn't cut it for reasons already