1.删除自带的viewController以及mainstoryboard之后黑屏的原因是没有关联新增的界面,
需要在配置文件中取消main界面的关联以及在项目属性中去掉关联并在appdelegate中关联新界面为根视图
self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
self.window.rootViewController = [[SignUpViewController alloc]initWithNibName:@"SignUpViewController" bundle:nil];
[self.window makeKeyAndVisible];
//- (void)makeKeyWindow;
让当前UIWindow变成keyWindow(主窗口)
//- (void)makeKeyAndVisible;
让当前UIWindow变成keyWindow,并显示出来
2.警告⚠️Assigning to ‘id’ from incompatible type ‘LoginViewController *__strong’
这个问题在设置代理对象的时候出现的,例如,在init方法里有这样的赋值:
self.loginView.delegate = self;
代理对象要给loginView进行代理。警告出现的原因是代理对象,没有实现被代理对象,也就是loginView的代理协议。
可以在实现文件里面这么改:
@interface LoginViewController()<LoginViewDelegate>
3.不响应手势
一定要设置允许用户交互
testimageView.userInteractionEnabled = YES;
4.
Implicit conversion of an Objective-C pointer to 'NSError *__autoreleasing _Nullable * _Nullable' is disallowed with ARC
在error前面加个*
5.Xcode无语法高亮 无代码智能提示 解决方法
~/Library/Developer/Xcode/DerivedData
~/Library/Caches/com.apple.dt.Xcode
把上面两个目录里的文件清掉
然后在xcode里面clean
6.flutter混编项目中:
This app could not be installed at this time.
Could not hardlink copy /Users/zhaoztcorp.21cn.com/Library/Developer/CoreSimulator/Devices/D4B603FF-C86B-470D-A34A-801FE594D4A0/data/Containers/Bundle/Application/9FB7DC3C-7222-4C11-86D0-8FF257A9FF88/TYUserCenter.app to /Users/zhaoztcorp.21cn.com/Library/Developer/CoreSimulator/Devices/D4B603FF-C86B-470D-A34A-801FE594D4A0/data/Library/Caches/com.apple.mobile.installd.staging/temp.eRYfUn/extracted/Payload/TYUserCen