Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7753045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:57:13+00:00 2026-06-01T11:57:13+00:00

For the old version xcode/ios, I used: appDelegate =(AppDelegate *)[[UIApplication sharedApplication] delegate]; to access

  • 0

For the old version xcode/ios, I used:

appDelegate =(AppDelegate *)[[UIApplication sharedApplication] delegate];

to access AppDelegate

#import "AppDelegate.h"


 @property (nonatomic,retain) AppDelegate *appDelegate;



#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate> {

}
@property (strong, nonatomic) UIWindow *window;


@end

//-----

#import <UIKit/UIKit.h>

#import "AppDelegate.h"
@interface DetailController : UIViewController{
}
  @property (nonatomic,retain) AppDelegate *appDelegate;



@end

but in ios5 AppDelegate change from NSObject to UIRepsonder

Is it possible to access the AppDelegate?

Welcome ant comment

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:57:15+00:00Added an answer on June 1, 2026 at 11:57 am

    I do not know what misconception you have in your mind. But What I use in iOS 5 application development is still same.

    As per your comment above you said you wrote this code:

    #import "AppDelegate.h"
    @property (nonatomic,retain) AppDelegate *appDelegate;  // This line is unnecessary
    

    You do not have to create property for AppDelegate class’s object. Just include this line in your .m file where you want to access global variable:

    // Create an AppDelegate variable in your MapViewScreen @interface
    AppDelegate *appDelegate;
    
    #import "AppDelegate.h"
    @implementation MapViewScreen
    
    - (void)viewDidLoad  
    {
        appDelegate = [[UIApplication sharedApplication] delegate];
    }
    

    P.S.: As Michael pointed out UIResponder inherits from NSObject so you do not have to worry. Everything’s the same.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just upgrade to Xcode 4.3.1 For the old version of Xcode, it is
I have an old Xcode project which contains a CoreData model (containing a version
UPDATE This is an old question for an old version of Xcode. It turned
Why are old SDKs beeing removed when installing a new version of xcode with
Does reinstalling a new version of Xcode automatically overwrite the old? e.g. I had
I am using Xcode 4.3.1 It is quite different from the old version. If
Hi I'm new to objective C. In the old version of Xcode, when we
Strange thing happened: My old 2.2.1 version iPod works perfectly with Xcode. Now I
[ Old question title used to be ARC is set to YES, but xcode
In my old version of TortiseSVN ( version 1.6) I could enable, a feature

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.