2012-02-10 48 views
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」我保證以後登錄正確驗證?

謝謝!

回答

10

您可以手動執行segues。 當您在故事板中創建一個segue時,而不是從按鈕到按鈕的Ctrl +拖動,從View Controller拖動到另一個View Controller。 給這個segue一個名字,然後在你的代碼中調用[selfseseguewithidentifier @「seguename」]

+0

Darren,謝謝你。它像一個魅力。但是,由於某些原因,當它切換到儀表板塞格時,它會變黑。有任何想法嗎? – pep 2012-02-11 22:58:38

+0

儀表板是否有視圖? – Darren 2012-02-11 23:10:19

+0

試試這個http://stackoverflow.com/questions/8945292/ios-5-black-screen-after-segue – Darren 2012-02-11 23:12:55