2012-05-11 28 views
0

我有一個主要的UINavigationController執行部分捲曲segue來顯示一組on/off開關。一些開/關開關必須確保存在配置變量(如四方形)。如果這些配置不存在,那麼我想推入另一個身份驗證Segue(再次,foursquare)。現在,如果我做的從視圖控制器上的偏下述捲髮Segue公司UINavigationController - >部分捲曲Segue - >另一個Segue?

FoursquareAuthViewController *controller = [[FoursquareAuthViewController alloc] init]; 
[self presentModalViewController:controller animated:YES]; 

的FoursquareAuthViewController將是部分捲曲的後面。讓這項工作適當的最佳方式是什麼 - 即。讓FoursquareAuthViewController佔據整個屏幕 - 最好從模態賽格?

我在考慮將源代碼控制器作爲代理傳遞給Partial Curl控制器,然後在切換開關時檢查配置是否存在。如果沒有,觸發委託推送FoursquareAuthViewController。這似乎只是一種愚蠢做這樣...

更新:

嘗試以下兩種犯規的其實做任何事情。

FoursquareAuthViewController *controller = [[FoursquareAuthViewController alloc] init]; 
[[[self presentingViewController] navigationController] pushViewController:controller animated:true]; 


FoursquareAuthViewController *controller = [[FoursquareAuthViewController alloc] init]; 
[[self presentingViewController] presentModalViewController:controller animated:YES]; 

回答

0

我不知道是否會有助於從源頭視圖控制器,而不是從交換機視圖控制器出示您的Foursquare的登錄視圖控制器。但是,如果是這樣,則不需要圍繞您描述的傳遞視圖控制器的「愚蠢」情況:從開關視圖控制器,您可以引用self.presentingViewController以獲取源視圖控制器。

+0

謝謝!這是我正在尋找的。但不幸的是,它實際上沒有做任何事情。見上面的更新。 – wuntee

相關問題