• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iPhone: Accessing variable from another view controller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iPhone: Accessing variable from another view controller


  • Subject: Re: iPhone: Accessing variable from another view controller
  • From: Luke the Hiesterman <email@hidden>
  • Date: Fri, 21 Aug 2009 06:55:19 -0700


On Aug 21, 2009, at 6:39 AM, Eric E. Dolecki wrote:

When I trace out the class, it is indeed the app delegate and NOT the firstViewController. That's pretty strange. I was expecting to get at the actual FirstViewController class.

What made you think that [[UIApplication sharedApplication] delegate]; would return a view controller rather than the app delegate? If you need a reference to this view controller perhaps it would be a good idea to declare a firstViewController property in your appDelegate and then you could do something like this:


[[UIApplication sharedApplication] delegate].firstViewController.availableNetwork;

While on that note, it's a actually probably even better of an idea to have the availableNetwork property exist in your appDelegate, since this is sort of generic application state property - it's not inherently the property of an individual view controller. So, then you'd end up with:

[[UIApplication sharedApplication] delegate].availableNetwork;

Luke
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: iPhone: Accessing variable from another view controller (From: "email@hidden" <email@hidden>)
 >Re: iPhone: Accessing variable from another view controller (From: Luke the Hiesterman <email@hidden>)
 >Re: iPhone: Accessing variable from another view controller (From: "Eric E. Dolecki" <email@hidden>)

  • Prev by Date: Re: iPhone: Accessing variable from another view controller
  • Next by Date: Re: iPhone: Accessing variable from another view controller
  • Previous by thread: Re: iPhone: Accessing variable from another view controller
  • Next by thread: Bindings & Reverting Properties
  • Index(es):
    • Date
    • Thread