uiapplicationdelegate

Difference Between Application Delegates

What is the difference between: [[UIApplication sharedApplication] delegate] and UIApplicationDelegate ...

Is there any advantage to deallocating objects owned by the UIApplicationDelegate?

Best practices aside, if I create an object that is owned by my UIApplicationDelegate class, and stays around the entire time the application runs, is there any real advantage to adding an [object release] statement in the UIApplicationDelegate's dealloc method? The only time that would be called is when the user is shutting down the ...

is it possible to reuse appdelegate in applicationDidFinishLaunching ?

Hi all, I am developing a tab bar application. I have five tabs in it. For each tab i have separate navigation controller. For each tab's table View I want to load data from a web service. I can do so for one tab by making a separate xmlparser class initializing it with appdelegate then call it in the applicationDidFinishLaunching ....

Showing a one-time UIViewController via presentModalViewController upon launch

Greetings! I have a working iPhone app (huzzah!) that uses a MainView.xib containing a fully-stocked UITabBar with several UINavigationController objects and views at-the-ready. I've now been asked to add a one-time registration view to this mix. This view would appear before the UITabBar at app-launch, get some info from the user, regi...

updating a variable in appDelegate

In the application delegate, I created an array for multiple view controllers to reference. However, when I try to update the array in one view, it comes up empty in the other. View 1: MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate]; dataTempForSearch = appDelegate.myData; I then have an xml...

Why Xcode shows warning when use AVAudioPlayer Delegate protocol in appdelegate.h file?

//---------MyAppDelegate.h @interface MyAppDelegate : NSObject <UIApplicationDelegate, AVAudioPlayerDelegate> { //---in some other .m file, trying to acess the device token residing in MyAppDelegate ---------- MyAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; // Results in // warning: type 'id ' does not c...

UISharedApplication bug that cannot be determined

-(void) setupMyLocation { NSArray *viewControllerArray = [navigationUpdateFromDetail.navigationController viewControllers]; NSUInteger parentViewControllerIndex = [viewControllerArray count] - 2; NSLog(@"Parent view controller: %@", [viewControllerArray objectAtIndex:parentViewControllerIndex]); switch(parentViewControllerIndex){ c...

UIApplication sharedAppication error: program seems to be accessing wrong file

in my MainViewController implementation, I need to access variables from two different classes. one of the classes is the AppDelegate and the other is the FlipsideViewController. the way I accessed these was through this code: -(void)someMethod { MyApplicationAppDelegate *appDelegate = (MyApplicationAppDelegate *)[[UIApplication sharedA...

Pausing Game when someone calls/SMS you.

I want to implement this function on my apps but i cant seem to figure out how to use this line of codes. - (void)applicationWillResignActive:(UIApplication *)application { //our app is going to loose focus since there is an incoming call [self pauseGame]; } - (void)applicationDidBecomeActive:(UIApplication *)application{ //the user...

Is there anything like viewDidLoad for the loading of the app's main xib?

As in the one defined with "Main nib file base name" in the app's Info.plist. Should I just use applicationDidFinishLaunching? ...

Where does UIApplication's handleOpenURL 'Return' to exactly?

I'm working on a handling a custom URL Scheme in an app and am trying to sort out: - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url I'm passing and successfully parsing a URL into an NSDictionary in my app but wondering "what now?" handleOpenURL returns a BOOL but to what? It's hard for me to debug as I hav...

can we check applicationwillresignActive in iphone simulator?

- (void)applicationWillResignActive:(UIApplication *)application { NSLog(@"resigning active status..."); } i have tried hardware-lock in iphone simulator but this isn't called. I do want to call it in another UIviewcontroller class not in the appdelegate itself.I also added in the viewController's header File. ...

iphone global settings - best way to implement it?

Hi all, I'd like to have some settings that I can access from anywhere in my app. Is there a best way to implement this? Right now I'm just sticking properties in my app delegate, then access them with: ClientAppDelegate *appDelegate = (ClientAppDelegate *)[[UIApplication sharedApplication] delegate]; settingValue = appDelegate.setting...

Hold "shared" views in app delegate or in root view controller? (iPhone OS)

Say I have two views: "day view" and "week view". In the week view, tapping on a day opens the day view for that day. I have a root view controller with two buttons: one leading to a day view for today, the other to the current week view. I want to be able to push any one of the view controllers on the UINavigationViewController's stack...

View Controller's viewDidLoad method finishing before applicationDidFinishLaunching

I'm creating a fairly complex iPhone app using Core Data. Up until now, things have been working fine. As the app has been getting more complex, however, a new problem has come up: the first view controller is finishing its viewDidLoad method before the AppDelegate gets even halfway through its applicationDidFinishLaunching method. The...

referencing an instantiated object in another class in objective C

hi, I am working in xcode on an ipod app in objective C, and I have a field (navigationController) in one of my classes (rootViewController). How do I reference the instantiated rootViewController's navigationController from another class? For example, how would I do this if I want to reference the navigationController from the FirstVi...

Saving data - does work on Simulator, not on Device

I use NSData to persist an image in my application. I save the image like so (in my App Delegate): - (void)applicationWillTerminate:(UIApplication *)application { NSLog(@"Saving data"); NSData *data = UIImagePNGRepresentation([[viewController.myViewController myImage]image]); //Write the file out! NSArray *paths = NSSe...

How do I call a method of the app delegate from a UIViewController?

Situation: I am using the "Navigation Based Application" project template. And my root view controller (UIViewController) needs to call a method of the app delegate. Question: How do I call a method of the app delegate from a UIViewController? ...

iPhone: Remove annotation from MKMapView which is in another view

I have two views. The first is a MKMapView with some annotations. Clicking a UIButton pushes a second view on the stack. This has a UITableView with a list of annotations which correspond to the map annotations. So, when you click the delete button, how can I call my MKMapView which is in another view, so that I can remove the annota...

How much should the AppDelegate do?

I'm designing quite a large App and on startup it will create sessions with a few different servers. As they are creating a session which is used across all parts of the app its something I thought would be best in App Delegate. But the problem is I need the session progress to be represented on the screen. I plan to have a UIToolBar at...