2

我对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”?

谢谢!

4

1 回答 1

10

您可以手动执行转场。在情节提要中创建 segue 时,不是 Ctrl+从按钮拖动到视图控制器,而是从视图控制器拖动到另一个视图控制器。给 segue 一个名字,然后在你的代码中调用 [self performeguewithidentifier@"seguename"]

于 2012-02-10T22:03:48.063 回答