Questions tagged [uiapplicationdelegate]

UIApplicationDelegate is a part of the UIKit framework used in iOS development

UIApplicationDelegate Protocol is available in /System/Library/Frameworks/UIKit.framework since iOS 2.0.

It declares methods that are implemented by the delegate of UIApplication object. It gives information on key events during application execution (finish launching, terminated, low memory, ...) (from iOS developer guide)

initial help

sample code

  • Could be found also in the official documentation
523 questions
13
votes
2 answers

When use [[UIApplication sharedApplication] delegate]

I don't know when or why I should use [[UIApplication sharedApplication] delegate] I use delegate when [self.navigationController pushViewController:myView Animation:YES] does't navigate. I make MyView *delegate = [[UIApplication sharedApplication]…
rasputin
  • 241
  • 1
  • 4
  • 13
13
votes
4 answers

applicationDidEnterBackground and applicationWillEnterForeground method are not called when pressed home button in iOS simulator

I need a long running task to be done in background as well as in foreground. This updates the core data. So to maintain UI responsive I created an another thread where I use different managedObjectContext(MOC). So a timer is set in background as…
aparna
  • 353
  • 2
  • 3
  • 13
12
votes
1 answer

Detect that an app launched into background state?

How do I detect that an app has launched into the background state? Needless to say regular apps cannot do this, only a small set of apps of the proper type can, and it is not an ideal situation. In particular Newsstand apps do this.
user945620
12
votes
1 answer

application:openURL:sourceApplication:annotation return NO versus YES

I am registering an application to handle being opened via URL and am confused with application:openURL:sourceApplication:annotation According to the documentation you should return YES if you can support the URL and NO if not. What good does this…
Chris Wagner
  • 20,773
  • 8
  • 74
  • 95
12
votes
3 answers

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

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…
VectorVictor
  • 693
  • 1
  • 10
  • 20
12
votes
3 answers

Back to app button handler

After programatically sending user to the settings screen, there's a back-to-app button in left upper corner: Tapping this button makes the user go back to my app. However, at that point Application calls its delegate with the same methods that are…
user3581248
  • 964
  • 10
  • 22
12
votes
2 answers

Detecting when app is becoming active from lockscreen vs other on iOS7

My app has different behavior when becoming active from the lockscreen (locked while active), or becoming active from anything else. On iOS 6 and lower I could detect this UIApplicationState state = [[UIApplication sharedApplication]…
coneybeare
  • 33,113
  • 21
  • 131
  • 183
12
votes
3 answers

Continue download in background

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 -…
Nitish
  • 13,845
  • 28
  • 135
  • 263
11
votes
3 answers

iOS – AppDelegate as instance variable?

Is it okay to have the AppDelegate as an instance variable in a UIViewController? Like @property (nonatomic, weak) AppDelegate *appDelegate; Why I'm asking is because I need to access it quite often so instead of doing: AppDelegate *appDelegate =…
Peter Warbo
  • 11,136
  • 14
  • 98
  • 193
11
votes
3 answers

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

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…
Greg
  • 34,042
  • 79
  • 253
  • 454
10
votes
1 answer

What happen if I return false in didFinishLaunchingWithOptions?

I tried to return the false in didFinishLaunchingWithOptions method, nothing happens my app run successfully, can anyone tell why this thing work, and what's the difference (true/false) here.
Rohit Kumar
  • 323
  • 3
  • 9
10
votes
1 answer

Background request not execute Alamofire Swift

I'm trying to make calls in background like POST,GET to be more precise in the didReceiveRemoteNotification method, because they start to work as a push notification arrive. My problem is that all the Alamofire.request are never call in Background…
9
votes
2 answers

How to detect what triggered applicationWillResignActive?

I have a Video Chat application that I want to disconnect from a call when the device is locked, but stay connected when an SMS, calendar, low battery or any other type of notification is received. The problem is, I cannot figure out for the life of…
jmason
  • 143
  • 1
  • 7
9
votes
1 answer

iOS app applicationWillEnterForeground and it stuck for a while

I add this function to post a notification when the app enter foreground: - (void)applicationWillEnterForeground:(UIApplication *)application { [[NSNotificationCenter defaultCenter] postNotificationName:…
jxdwinter
  • 2,339
  • 6
  • 36
  • 56
8
votes
3 answers

Adding an Activity Indicator Programmatically to a View

Possible Duplicate: Show activity indicator during application launch All, Inside my app delegate, I created an animated splash view that uses my Default.png. That all works OK but I cannot figure out how get my ActivityIndicator to display on…
Slinky
  • 5,662
  • 14
  • 76
  • 130
1 2
3
34 35