iphone - 登录检查后执行 Segue

标签 iphone xcode4 ios5 storyboard segue

我对 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/

相关文章:

iphone - 在 iPad 上运行但在模拟器中没有显示图像

ios - 如何按字母顺序将 pList 分成组,如 iOS 联系人

ios - 如何在 UITableViewController 中显示无数据启动 UIView?从 tableView 添加和删除 View ?

iphone - iOS 5 - AFNetworking - 上传视频

ios - 使用 sqlite 数据按字母顺序对 UITableView 进行排序

iphone - 有没有办法在 iOS 上运行脚本?

iphone - 无法使用 Xcode 4.2 构建到 4.2.1 设备

c++ - 生成错误 :Undefined symbols for architecture x86_64:

ios - 如何设置回默认的 UISegmentedControl 外观?

ios - Xcode 8 - iOS 10.0.2 : Error mounting developer disk image