###iOS开发常见问题解决汇总
####代码篇
-
隐藏空白cell的分割线
UIView *footer =[[UIView alloc] initWithFrame:CGRectZero]; myTableView.tableFooterView = footer; [footer release];
-
通过NSURL初始化本地路径的时候最好使用fileURLWithPath,这样系统会自动加上file://前缀,否则使用NSURL时可能会提示错误
-
iOS8由于路径变化,现在通过NSSearchPathForDirectoriesInDomains获取的路径会产生一个随机路径,所以应用中应该保存相对路径。
-
[NSCalendar currentCalendar]会比较耗时,可以通过全局变量或者属性保存起来
####工具篇
-
打印CoreData调试信息,需要添加参数
-com.apple.CoreData.SQLDebug
-
po [[UIWindow keyWindow] recursiveDescription] 可以打印当前视图的层级结构
-
po [[[UIWindow keyWindow] rootViewController] _printHierarchy] 可以打印当前视图控制器的层级结构