0

still having problems!

I have 2 classes, and i want to access the properties of one class from the other.

I have a class called MenuViewController, which is a Facebook styled popout menu, and depending on which cell is selected, i want to load different data.

I have created a property:

@property int rowSelected;

and synthesized it:

@synthesize rowSelected;

and in my other class, i have created an instance of the class:

MenuViewController *menu = [[MenuViewController alloc] init];

NSInteger rowValue = menu.rowSelected;

and when i NSLog it, it always returns 0...

NSLog(@"%i", menu.rowSelected);

Help is much appreciated!

4

1 回答 1

0

调用alloc创建一个 MenuViewController实例。除非您在其方法中为您的属性设置一个值,否则init您应该期望它为 0。

于 2012-12-01T20:08:54.827 回答