• 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
Accessing Regional iVars: Best Design Method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accessing Regional iVars: Best Design Method


  • Subject: Accessing Regional iVars: Best Design Method
  • From: Frederick C.Lee <email@hidden>
  • Date: Wed, 24 Mar 2010 09:03:18 -0700

Environment: iPhone SDK 3.1+

Greetings:

I wish to design a UITabBarController application where each descendent member of a particular UITabBarItem has access to its regional iVars, stored within the UITabBarItem.

Hence we could multiple tabs, each having the SAME hierarchy of member view controllers with their respective regional iVars.

Here's an example:

I've created a NSString var called 'ricString' with some token value, in the root view controller of a
UINavigationController system/UITabBarItem.  I can access this particular iVar thusly:

(gdb) po [[self navigationController] viewControllers]
<NSCFArray 0x3e5a570>(
<IRMLaunchController: 0x3e25800>,
<IRMSerialNumberSearchController: 0x3e8fcf0>,
<IRMDetailsController: 0x3e90330>
)
(gdb) po [[[[self navigationController] viewControllers] objectAtIndex:0] ricString]
Hello Ric!
(gdb)

I want to store mutually-shared iVars ("regional" iVars) for each UITabBarItem to be shared 'regionally'.

What would be the best way to access these iVars from within the hierarchy?
... Or must I drill through the array of View Controllers as I've done?

Regards,

Ric._______________________________________________

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

  • Prev by Date: Re: NSWindow subclass VERY slow to resize
  • Next by Date: Sending a Cmd-V keystroke
  • Previous by thread: re: Creating NSMappingModel programmatically
  • Next by thread: Sending a Cmd-V keystroke
  • Index(es):
    • Date
    • Thread