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 7888181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:46:06+00:00 2026-06-03T05:46:06+00:00

I am using App Delegate object in different classes. I want access it in

  • 0

I am using App Delegate object in different classes. I want access it in whole project. Am define this object in Prefix.pch file as

#define Appdelegate (AppDelegate *)[[UIApplication sharedApplication] delegate]

but problem is that Appdelegate variable does not access App delegate variable.
it Shows error.

but if am use this code works fine

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

Am I doing it correct or is there a way of doing what I do?

thanks in Advance.

  • 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-03T05:46:07+00:00Added an answer on June 3, 2026 at 5:46 am

    Should be:

    #define Appdelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate])
    //                  ^----------------------parenthesis--------------------------^
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following Audio Session in my app delegate: AudioSessionInitialize(NULL, NULL, NULL, self);
I'm using Google App Engine python. I want to know what browser the user
In my iPhone app, I'm publishing a bonjour service and using the following delegate
I found several posts online stating that I could access my application delegate object
#import Mutation.h //my class @implementation NTAppDelegate using app delegate as controller @synthesize window =
I'm using App Engine, SDK 1.6.3 with Python 2.7. I've created a model like
I am trying to write a facebook app using app-engine-patch and pyFacebook. I am
How do I set IncludeExceptionDetailInFaults in code without using App.Config?
When using Google app engine is there any benefit to use a CDN if
When using Google App Engine 1.6.4 testbed with Flask 0.8, and in particular the

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.