I have a ClassA, ClassB, ClassC.
In ClassA,
I want to use these values in classB.
I used
C
So, I can get the values from ClassA and use them in ClassB.
But, I read that
creates an empty object. So, we cannot access any values from ClassB in to ClassA.
But, in some cases I am able to access the values and I can see the values by using NSLog in ClassB.
But, some times I see the values are 0.
What is the correct method of accessing the values from ClassA into ClassB ?
Thank you.
In ClassA,
Code:
@interface ClassA : NSObject
{
NSString *enemyDescription;
int numberOfEnemies;
}
@property(nonatomic, retain) NSString *enemyDescription;
@property(nonatomic, assign) int numberOfEnemies;
I used
C
Code:
lassA * aclassA = [[ClassA alloc]init]; in classB.
But, I read that
Code:
ClassA * aclassA = [[ClassA alloc]init];
But, in some cases I am able to access the values and I can see the values by using NSLog in ClassB.
Code:
NSLog("string: %@", aclassA. enemyDescription);
What is the correct method of accessing the values from ClassA into ClassB ?
Thank you.