In iOS, the app delegate is responsible for managing the app throughout its lifecycle by responding to events such as launch and termination.
Questions tagged [appdelegate]
2019 questions
14
votes
3 answers
How to change RootViewController in AppDelegate From Other ViewController?
This is didFinishLaunchingWithOptions Method in AppDelegate.
Let me explain scenario, I have developed sideMenu like facebook in my app, but now I have to change the sideMenu list according to screens (ViewController)
Here the side Menu is…

Chatar Veer Suthar
- 15,541
- 26
- 90
- 154
14
votes
1 answer
The app delegate must implement the window property if it wants to use a main storyboard file
I'm programmatically implement a list view controller.
When I try to run the project, I got error:
2012-11-07 22:46:34.719 myTableViewControl[12021:c07] The app delegate must implement the window property if it wants to use a main storyboard…

max
- 645
- 3
- 11
- 22
13
votes
2 answers
Why is didReceiveRemoteNotification not called but didReceiveRemoteNotification:fetchCompletionHandler called when my app is in the foreground?
If I override
override func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
println("hey)
}
I successfully…

Adam Johns
- 35,397
- 25
- 123
- 176
13
votes
5 answers
Pausing timer when app is in background state Swift
My ViewController.swift
func startTimer() {
timer = NSTimer().scheduleTimerWithTimerInvterval(1.0,target: self,selctor: Selector("couting"),userinfo: nil, repeats: true)
}
func pauseTimer() {
timer.invalidate()
println("pausing…

user528432
- 411
- 2
- 5
- 18
13
votes
6 answers
Launching ViewController from AppDelegate
I have a custom URL scheme and i want to open a certain ViewController which is not the root when i go to this URL. I have been able to do that and what remains is pushing this ViewController into the navigationController from the AppDelegate where…

Elgert
- 470
- 2
- 5
- 19
13
votes
3 answers
Call a method from AppDelegate - Objective-C
I was trying to call an existing method of my ViewController.m from AppDelegate.m inside the applicationDidEnterBackground method, so I found this link: Calling UIViewController method from app delegate, which told me to implement this…

lucas_turci
- 315
- 1
- 3
- 12
12
votes
1 answer
Close SwiftUI application when last window is closed
Is it possible to close a macOS SwiftUI application when the last window is closed by the user, similar to the applicationShouldTerminateAfterLastWindowClosed AppDelegate function.
func applicationShouldTerminateAfterLastWindowClosed(NSApplication)…

Duncan Groenewald
- 8,496
- 6
- 41
- 76
12
votes
3 answers
Detecting shake in AppDelegate
How can I detect a device shake in the AppDelegate (across the entire app) in Swift?
I've found answers that describe how to do so in a view controller, but looking to do so across my app.

Liran Cohen
- 194
- 2
- 9
12
votes
3 answers
Array Index Out of Bounds issue (NSRangeException) in -[NSManagedObjectContext save:]
My iOS application just crashed with a NSRangeException on -[NSManagedObjectContext save:]. Nothing else helpful anywhere to be found. How am I supposed to fix this? I don't get any memory address or anything that I can work with...
2015-04-22…

vrwim
- 13,020
- 13
- 63
- 118
12
votes
1 answer
Calling UIViewController method from app delegate
I know there are duplicates of this question but my situation is different here.
When user goes back to the home (void)applicationDidEnterBackground gets invoked from the AppDelegate class. However once user presses home button, I don't want user to…

Sarp Kaya
- 3,686
- 21
- 64
- 103
12
votes
2 answers
Getting appdelegate value from viewcontroller
In Appdelegate.h
I imported the playerviewcontroller in both Appdelegate.h and Appdelegate.m files.
@class PlayerViewController;
@property(nonatomic)float volumeDelegate;
In Appdelegate.m
@synthesize volumeDelegate;
-…

AlgoCoder
- 1,706
- 5
- 19
- 40
12
votes
2 answers
this class is not key value coding-compliant for the key view.'
I have a problem in AppDelegate, when run the app I get this error:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[ setValue:forUndefinedKey:]:
this class is not key value…

Ortensia C.
- 4,666
- 11
- 43
- 70
11
votes
2 answers
Firebase google signin authentication AppDelegate- Use of unresolved identifier 'isMFAEnabled'
I'm new to iOS development. I am trying to add google sign in to my app but i am facing an some problems.Code shows some "Use of unresolved identifier 'isMFAEnabled"and "Value of type 'AppDelegate' has no member 'showTextInputPrompt'".Please help…

Gleny Rebellow
- 111
- 1
- 8
11
votes
2 answers
iOS push notifications and AppDelegate methods behaviour
I did some research on lots of stackoverflow issues and websites in trying to figure out how do the iOS push notifications influence AppDelegate lifecycle methods and when is which method (not) getting triggered. Main focus of the research was on…

uerceg
- 4,637
- 6
- 45
- 63
11
votes
2 answers
Programmatically set rootViewcontroller for UINavigationcontroller in Storyboard in Appdelegate
I have a value in NSUserdefaults. I am using storyboard, it is embedded in UINavigationController.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if([[NSUserDefaults…

Aswathy Bose
- 4,279
- 4
- 32
- 44