一些開發中的常見問題:html
一、interface builder 使用ios
identity inspector 的key path 能夠用來作圓角按鈕和邊框,不用在代碼裏面寫。多線程
layer.cornerRadius number 圓角按鈕app
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];ide
manager.requestSerializer.timeoutInterval = 10;佈局
[self performSelectorOnMainThread:@selector(updateUI:) withObject:image waitUntilDone:YES];post
八、UI自動佈局ui
layout有三種方式:Manual layout,Autoresizing,Autolayout。咱們經常使用的可能就後面兩種。url
假設v1是一個不使用autolayout的view,而v2是一個使用autolayout的view,但v1成爲v2的subview時,spa
v2須要四條隱含的constraint來肯定v1的位置,這些約束都是從v1的frame轉化而來:
This conversion is performed only if the view in question has its translates-
AutoresizingMaskIntoConstraints property set to YES. That is, in fact, the default if
the view came into existence either in code or by instantiation from a nib where 「Use
Auto Layout」 is not checked. The assumption is that if a view came into existence in
either of those ways, you want its frame and autoresizingMask to act as its constraints
self.navigationController popToRootViewControllerAnimated:YES]
UIViewController *prevVC = [self.navigationController.viewControllers objectAtIndex:<n>]; [self.navigationController popToViewController:prevVC animated:YES];
[self.navigationController popViewControllerAnimated:YES];
(那麼能夠經過單例、代理模式、notify等各類形式傳遞)
十、UIViewoController的關係
willMoveToParentViewController:
method of the child view controller before calling the
removeFromParentViewController
method...
Thus, as discussed in Adding and Removing a Child section of the View Controller Programming Guide, when removing a child, we should:
[childVC willMoveToParentViewController:nil];
[childVC.view removeFromSuperview];