2013-05-13 182 views
0

嗨,我是新的目標c。我正在嘗試創建一個登錄系統應用程序。在iphone應用程序加載視圖後加載數據

這裏是我的故事板看起來像:

enter image description here

我將使用AFNetworking類和休息PHP庫數據說話。

現在,你可以看到我創建了我的第一個應用程序使用推,模態和導航導航。

我在哪裏stucked

當應用程序在用戶的標誌點擊按鈕,在應用第一將授權用戶,然後將用戶找地方查看。

我需要的是當我點擊登錄按鈕時,首先會打開地方查找器視圖,然後調用將顯示使用rest api eith json格式的地點數據的函數。

- (IBAction)signin:(id)sender { 
    [self performSegueWithIdentifier:@"landingView" sender:sender]; 
    } 


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 

    if ([[segue identifier] isEqualToString:@"landingView"]) { 
    // what i do here to call function -"display_place" of class -"showplaces"???? 

    } 
} 

我希望我能得到一些想法,如果我正確的或我應該做下一步?

感謝

回答

0

可以使用destinationViewController酒店需要從SEGUE:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 

    if ([[segue identifier] isEqualToString:@"landingView"]) { 
     [((showplaces *)segue.destinationViewController) display_places]; 
    } 
} 

順便問一下,你是不是使用的類和函數命名正確...你應該看看其他示例和教程,以瞭解Objective C的代碼風格如何。

+0

嗨@ k20,非常感謝您的回答。 – Adhaata 2013-05-14 10:54:23

+0

這就是我在做完你所說的事情之後得到的。 'showplaces'沒有可見的@interface聲明選擇器'display_place' – Adhaata 2013-05-14 10:57:03

+0

以訪問類函數,它需要導入到類的頂部(#import「showplaces.h」)。另外,請確保在您的showplaces.h中聲明瞭「display_place」 – k20 2013-05-14 17:00:13

相關問題