我对 iPhone 开发有点陌生......所以请耐心等待!
我有一个登录屏幕,可连接到我开发的 REST API。它来回发送 json 请求。基本上,当您单击“登录”时,它会检查用户名/密码是否有效(显然)。
这是我的基本逻辑:
- (IBAction)sendLoginJson:(id)sender {
// send JSON request to server.. etc
NSURLConnection *myConnection = [NSURLConnection connectionWithRequest:request delegate:self];
[myConnection start];
}
然后转到
- (void)connectionDidFinishLoading
// this is where I get the response from the server
在确保登录验证正确后,如何切换到“DashboardViewController”?
谢谢!
最佳答案
您可以手动执行转场。 在 Storyboard中创建 Segue 时,不要按住 Ctrl 键并从按钮拖动到 View Controller ,而是从 View Controller 拖动到另一个 View Controller 。 给segue一个名称,然后在代码中调用 [self Performseguewithidentifier@"seguename"]
关于iphone - 登录检查后执行 Segue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9234652/