You probably need to @synthesize the property in FirstViewController's @implementation. If it compiles but just doesn't work, log the output of this line:

NSLog(@"class of app delegate: %@", [fvDelegate class]);

....because it seems very odd to me that your app delegate is also a view controller - that's not how things generally work, (and probably not a good design idea).

Luke

On Aug 21, 2009, at 6:28 AM, [email protected] wrote:

i caught that after sending. it still does not work

----------
Sent from the Verizon network using Mobile Email

------Original Message------
From: Luke the Hiesterman <[email protected]>
To: "Eric E. Dolecki" <[email protected]>
Cc: "cocoa-dev" <[email protected]>
Date: Fri, Aug 21, 6:22 AM -0700
Subject: Re: iPhone: Accessing variable from another view controller


On Aug 21, 2009, at 5:54 AM, Eric E. Dolecki wrote:

FirstViewController *fvDelegate = (FirstViewController *)
[[UIApplication
sharedApplication] delegate];

BOOL online = FirstViewController.availableNetwork;

This should be fvDelegate.availableNetwork. You access the property on
the instance, not the class.

Luke


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to