新手。。
寫了個登陸微博的小demo,獲取token後打算跳轉到別的頁面,
- (void)sinaweiboDidLogIn:(SinaWeibo *)sinaweibo
{
[self saveWeiboInfo];
NSLog(@"uid= %@ accessToken= %@", sinaweibo.userID, sinaweibo.accessToken);
[self performSegueWithIdentifier:@"login" sender:self];
}
獲得token後報錯:
2013-02-18 17:31:50.683 WeiboTimeline[5690:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<WeiboLoginViewController: 0x712a850>) has no segue with identifier 'login''
segue的identifier已經設置好了
但是。。在viewdidLoad裡,很奇怪的卻能跳轉
- (void)viewDidLoad
{
[super viewDidLoad];
NSDictionary *dic = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"weiboUserData"];
NSString *token = [dic valueForKey:@"access_token"];
NSLog(@"token= %@", token);
if (token != nil) {
[self performSegueWithIdentifier:@"login" sender:self];
}
}
上面這樣,token獲取了保存後,下次再打開應用就能跳轉。。
明明是一樣的代碼。。為什麼上面那個報錯。。。求解
http://blog.csdn.net/liangguo03/article/details/7956163
你參考一下這個調試的文章