I have changed the variable declarations of the existing class, UserInfoBean.m from instance variables to properties like given below. The commented line are the old piece of code.
//Should contain all statics and should be available to all
@interface UserInfoBean : NSObject {
NSString *_userName;
NSString *_url;
NSString *_presentNode;
}
@property (nonatomic, retain) NSString *userName;
@property (nonatomic, retain) NSString *url;
@property (nonatomic, retain) NSString *presentNode;
//+ (NSString *)userName;
//+ (NSString *)url;
//+ (NSString *)presentNode;
//
//+ (void)setUserName:(NSString *)newVa;
//+ (void)setUrl:(NSString *)newVa;
//+ (void)setPresentNode:(NSString *)newVa;
@end
Along with these changes, I have modified the access and initialisation of these properties at other parts of the porjects. I see things working fine till LoginViewController where these properties are assigned. However, at the later point, when the UI screen is rendered, the call goes to SystemViewContorller, and now, these values becomes null. I created the object of UserInfoBean in SystemViewController
SystemViewController.h
@interface SystemViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>{
....
UserInfoBean *userBeanNewObj;
.....
}
SystemViewController.m
@synthesize userBeanNewObj;
.......
cell2.label2.text = userBeanNewObj.userName;
//cell2.label2.text = [UserInfoBean userName];
cell2.label2.text = userBeanNewObj.url;
//cell2.label2.text = [UserInfoBean url];
So, I was expecting that after changing to the properties, I could access these variables from the object of that class userBeanNewObj but thats not happening, and I see only null values for the object and the properties. Any idea to go past this will be appreciated.
Thanks in advance !