data between classes is not being passed in iphone
I want to assign a value of an integer data from a different class. So I
did the following
suppose I want to assign Value of class B from class A, So i did this
in B.h file
@interface B : UIViewController {
int num;
}
@property(readwrite)int num ;
in B.m file
@synthesize num;
now In A.h file
@property(nonatomic,strong)B *b;
then in A.m file
b=[[B alloc]init];
b.num=5;
the problem is when I NSLOG the num using
NSLog(@"The Number is %d",num);
in the B class it always shows 0, I have tried with nsstring and it also
passes NULL, I am stuck here, please any body can help?
No comments:
Post a Comment