1、Cannot create __weak reference in file using manual reference counting
解决办法:
点击工程-------->Build Settings--------->Apple LLVM8.1 - Language - Objectibe-C------------->Weak Reference In Manual Retain Release设置为YES。
2、CUICatalog:Invalid asset name supplied
这个问题其实是老问题,产生原因就是因为在使用的时候 [UIImage imageNamed:]时,图片不存在或者传入的图片名为nil.
解决方法:添加一个系统断点,来判断如果图片名字为nil或者@""的时候,来拦截掉。
3、iOS设置translucent引发的导航栏色差和坐标问题
//设置全局导航栏的半透明状态为NO,可以解决导航栏的色差问题,同时需要设置窗口背景色,防止跳转时出现黑色导航栏现象
self.window.backgroundColor = [UIColor whiteColor];
[[UINavigationBar appearance] setTranslucent:NO];
4、tabBarItem的选中与非选中时,背景颜色,字体颜色
//tabBar和navigationBar结合使用 UIViewController *vc = [UIViewController new]; UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; vc.tabBarItem.title =@"首页"; //设置tabbar被选中与未被选中的图片 nav.tabBarItem.image = [[UIImage imageNamed:@"home_btn"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; nav.tabBarItem.selectedImage = [[UIImageimageNamed:@"home_btn02"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];; //设置navigationbar的颜色 [nav.navigationBarsetBarTintColor:kAppNavigationBarColor]; //或设置navigationbar的背景图片 [nav.navigationBar setBackgroundImage:navBarBackgroundImage forBarMetrics:UIBarMetricsDefault];
5、Mac电脑如何查看IP地址
解决办法:打开终端,输入命令行:ifconfig | grep "inet" | grep -v 127.0.0.1
如图: