既然viewDidUnload
和shouldAutorotateToInterfaceOrientation
已被iOS 6棄用,我們應該在MonoTouch中替換它們嗎?ViewDidUnload和ShouldAutorotateToInterfaceOrientation替換爲MonoTouch
5
A
回答
6
viewDidUnload
兩個viewDidUnload
和viewWillUnload
通過iOS6的不叫了。 Xamarin的發佈說明MonoTouch 6涵蓋此以及Apple documentation。
shouldAutorotateToInterfaceOrientation
兩種新方法(在iOS6的,在MonoTouch中可用)可以重寫,以獲得相同的結果。 有關詳細信息,請參閱選擇器的Apple documentation。
請注意,shouldAutorotateToInterfaceOrientation
仍然被調用(它已被棄用和不鼓勵未來使用,但如果您支持舊版本的iOS,仍然可用)。
7
ViewDidUnload()
你可以刪除。如果你有代碼,你必須將它移動到ViewWillDisappear()中,並將其移到ViewWillAppear()
。 WWDC 2012的相關講座是第236集(視圖控制器的演變)和200(Cocoa Touch的新內容)。
ShouldAutoRotateToInterfaceOrientation()
被SupportedInterfaceOrientations().
取代在這裏看到:http://dhilipsiva.com/2012/07/25/ios-6-ui-interface-orientation-shouldautorotatetointerfaceorientation-not-working.html
相關問題
- 1. MvvmCross - MvxViewController和ShouldAutorotateToInterfaceOrientation
- 2. shouldAutorotateToInterfaceOrientation和UINavigationController的
- 3. ARC和viewDidUnload
- 4. didReceiveMemoryWarning和viewDidUnload
- 5. shouldAutorotateToInterfaceOrientation不被稱爲
- 6. MonoTouch的IPA替換同一計算機
- 7. MonoTouch的IsolatedStorageSettings替代
- 8. shouldAutorotateToInterfaceOrientation和圖像旋轉
- 9. UITabBarController中的UIViewController和UISplitViewController shouldAutorotateToInterfaceOrientation
- 10. GPUImage和Monotouch綁定或替代
- 11. shouldAutorotateToInterfaceOrientation&UINavigationController
- 12. mainwindow shouldAutoRotateToInterfaceOrientation
- 13. UISplitViewController shouldAutorotateToInterfaceOrientation
- 14. 替換爲findfirst()和findnext()
- 15. 替換爲RegEx和JavaScript
- 16. didReceiveMemoryWarning和viewDidUnload內存問題
- 17. viewDidUnload和didReceiveMemoryWarning兼容性
- 18. 釋放viewDidUnload和dealloc兩者?
- 19. iPhone dealloc和viewDidUnload問題
- 20. IBOutlet和viewDidUnload在ARC下
- 21. xively(替換爲Cosm(替換爲Pachube))示例和圖表
- 22. MonoTouch的替代語言
- 23. shouldAutorotateToInterfaceOrientation返回YES
- 24. shouldAutorotateToInterfaceOrientation從代理
- 25. shouldAutorotateToInterfaceOrientation單視圖
- 26. 的UIViewController shouldAutorotateToInterfaceOrientation
- 27. shouldAutorotateToInterfaceOrientation not working
- 28. 替換和轉換
- 29. Monotouch:將對象轉換爲NSObject
- 30. MonoTouch將alpha彩色UIImage轉換爲灰度和模糊?
如果我針對5.1版爲什麼我仍然得到這些警告?如果設備運行5.1,那麼這些方法會被調用嗎? –
由於MonoTouch 6與iOS6 API *同步,並且'[Obsolete]'允許C#編譯器發出警告(但編譯器並不是您的目標)。 iOS 5.1沒有改變,因此'viewDidUnload','viewWillUnload'將像以前一樣被調用(即它是iOS,而不是MonoTouch,它會停止調用它們)。 – poupou
這是否意味着在iOS 6中發佈了一組方法(或檢查),而在舊版本中則完全不同?我知道這個輪換系統現在是通過plist和SupportedInterfaceOrientations方法中的信息進行的,但是在舊版本中是否支持並調用此方法?我懷疑我們的應用程序的每個用戶都會升級到iOS 6,因此我希望對這些過時的警告有更清晰的瞭解。目前我只是無視它們,但我幾乎不說這是安全的。 –