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

  • Home
  • SEARCH
  • 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 5969717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:16:13+00:00 2026-05-22T20:16:13+00:00

What is the preferred method of accessing ivars from different classes? Application Delegate Class

  • 0

What is the preferred method of accessing ivars from different classes?

Application Delegate Class

Say I want to access the root controller (@synthesized as rootController) from the Application Delegate class in another UIViewController class. I’ve read somewhere that you access ivars from the Application Delegate class differently than you access other ivars.

Regular Class

If I want to access some ivars from lets say another UIViewController class. I would like to access the ivar which contains a list (NSArray) of names (@synthesized as names) in class A and get access to them from class B.

The ivars have default access (protected).

Perhaps you can point me to a good tutorial explaining how to access ivars.

  • 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-05-22T20:16:15+00:00Added an answer on May 22, 2026 at 8:16 pm

    The application delegate is a singleton so you can access those properties from anywhere.

    In the case of a ‘normal’ class, and assuming you don’t want to make it a singleton, you would normally use the delegate pattern. This means that class A becomes the delegate for class B and class B can call methods that class A will implement, this is how UITableViews work with the DataSource delegate.

    This only works if you only need to access these properties from one other class (delegates don’t support multi-delegates without a bit of hackery), otherwise I would encapsulate your data in a model which any class can access.

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

Sidebar

Related Questions

I'm used to Atlas where the preferred (from what I know) method is to
What is people's prefered method of storing application configuration data in a database. From
According to the View Controller Programming Guide, delegation is the preferred method to dismiss
I've seen several different ways for :use in clojure--what's the idiomatic/preferred method? #1 (ns
I know the preferred method for returning scalar values from stored procs is either
When writing an Android application, what is the preferred method to store constant values,
I've got to access text inside a flash object. The preferred method is via
What's your preferred method of providing a search facility on a website? Currently I
What is your preferred method for reading through the contents of zipped directories with
What is your preferred method of traversing a tree data structure, since recursive method

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.