ios UIViewController的誤用


若是在一個UIViewController中有以下代碼,你可能就在誤用UIViewController html

[viewController.view addSubview:someOtherViewController.view];

viewController.view.bounds = CGRectMake(50, 50, 100, 200);
我也在誤用,今天寫程序的時候發現了個問題,在和同事探討了許久他沒有說服我,知道看了如下幾個連接後,我知道本身確實錯了。。。

故記錄一下,以便後來檢討,繼續學習。 ios

0)Abusing UIViewController app

http://blog.carbonfive.com/2011/03/09/abusing-uiviewcontrollers/ iview

1) view controller programming guide for ios ide

http://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html 學習

2)view controller basics ui

http://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/AboutViewControllers/AboutViewControllers.html#//apple_ref/doc/uid/TP40007457-CH112-SW12 code

相關文章
相關標籤/搜索