我有一个问题,我WSLogin
从我的Loginviewcontroller
. 它成功返回了我的用户sessionId。然后我将此sessionId存储到字符串中并将此值发送到Searchviewcontroller
但未成功将值提交到Searchviewcontroller
.
当我成功登录时,我Searchviewcontroller
通过标签栏控制器移动到。NSLog
我在成功登录后searchviewcontroller
单击时生成检查会话的值,然后返回给我,请告诉我如何解决这个问题?searchtabbar
NSLog session id = null
这是代码
// LoginViewController.m file
-(IBAction)Login:(id)sender
{
wsobject = [[WSLogin alloc] init];
sessId = wsobject.sessionId;
NSLog(@"sessionidd = %@",sessId);
// it successfully return session id
}
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
SearchViewController *afc = (SearchViewController *) segue.destinationViewController;
afc.sessionId = sessId;
// i have create sessionId property in SearchViewController
}
// SearhViewController.m file
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"sessionId = %@",sessionId);
//printing sessionId value but getting Null here when click on Searhtabbar
}