错题集
1.使用CocoaPods时出现重新写了一了 Podfile 文件:
3140363C-E163-4122-A75B-DD21AE4E4A33.png删除命令:
rm -rf .Podfile.swp
2.拒绝审核理由
Information Needed
Your iTunes Connect settings indicate that your app serves third-party advertisements. However, we were unable to locate ads in your app.
Please reply to this message to provide the steps for locating third-party ads in your app. When we hear back from you, we will continue the review.
3.no-input file
解决方法:
219B6AF1-C48C-4D9C-9C68-E8EB3D222C9B.png
]
4.问题是:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/update_rubygems
解决方法:
sudo gem install -n /usr/local/bin cocoapods
5.ARC&MRC混编
MRC修改为可编译的ARC文件解决方法:
1.MRC修改为可编译的ARC文件时添加
[-fno-objc-arc]
2.ARC修改为可编译的MRC文件时添加
[-fobjc-arc]
6.请求数据返回状态码[NSCFNumber]
和[NSString]
比较
返回的状态码进行判断
[responseObject[@"status"]]
就是需要比较的返回值解决方法:
NSString *tempStr = [NSString stringWithFormat:@"%@",responseObject[@"status"]];
if ([tempStr isEqualToString:@"1"]) {
}
[responseObject[@"status"] isEqualToNumber:[NSNumber numberWithInt:1]]
[responseObject[@"status"] isEqualToNumber:@1]
7.开发中自己命名的类和系统中重复时会提示
Message is implemented in both XXX文件和XXX文件
One of the two will be used. Which one is undefined.
解决方法:
在开发过程中难免会出现这种情况,在[stackoverflow]
网站有解决方案在[csdn]
网站上中文解释
不过,我没有成功,而是重新命名了,感觉很酸爽
8.本地数据没有同步到服务器上导致模拟机测试正常,真机测试失败
warning: could not load any Objective-C class information from the dyld shared cache.
This will significantly reduce the quality of type information available.
解决方法:
ps.也有可能在其他问题上出现这个警告,挖个坑先
9.[@class]
问题
ChartView为自定义的视图
解决方法:
将上面的注掉的去掉就可以了关于
[@class]
相关参考
@class ChartView;
10.[Undefined symbols for architecture i386]
在使用第三方登陆的时候,调用[TencentOpenAPI]
报错
解决方法:
并没有解决,啊哈哈哈哈哈哈哈
不过,在这里好像有点意思,相关参考
11. 真机测试[Unsupported device model]
运行时出现⌘+R“(null)” is of a model that is not supported by this version of Xcode. Please use a different device.
clean时出现⌘+SHIFT+KCannot (null) '项目名字'.
解决方法:
重启Xcode就可以了,😆😆😆
12.warning: Missing file: XXX is missing from working copy 警告错误解决
解决方案:
相关参考
13. duplicate interface definition for class ""
重复引入文件
解决方案:
找到重复的文件/文件夹,直接删除
14.is missing from working copy
我的是在git 情况下出现的问题
其实你的文件已经丢失.是无法cd 到你的那个文件下的
所以,应该是cd到你的工程下,再执行git 命令才行
git rm 丢失的文件路径
如果你太多的警告是在同由于同一个文件夹的丢失可以直接删除文件夹,其实就是批量删除,执行命令如下:
git rm -m 丢失的文件夹名字
解决方案:
相关参考
15播放一段自定义音效初现问题
音频的路径不对把要播放的音频放在TARGETS - Build Phases -Copy Bundle Resources里
/**
* inFileUrl:音频文件url
* outSystemSoundID:声音id(此函数会将音效文件加入到系统音频服务中并返回一个长整形ID)
*/
AudioServicesCreateSystemSoundID((__bridge CFURLRef)(url), &soundID);
上面这段代码崩溃是因为我的全局断点条件设置不对.
将断点条件由``All``改为``Object-C``15 自定义静态变量static
加入const
出现警告
Sending 'const NSString *__strong' to parameter of type 'NSNotificationName _Nonnull' (aka 'NSString *') discards qualifiers
自定义字符串
static const NSString *name = @"wtf";
static NSString *const name = @"wtf";
解释:前者相当于指针本身不可修改,后者表示指针指向的内容不可修改,两者的作用都是使firstString只可读不可写。
相关参考
16TableView补全分割线
//实现下面的代理方法即可tableview 分割线补全
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
[cell setPreservesSuperviewLayoutMargins:NO];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
17.打印数据很多
OS_ACTIVITY_MODE disable
Run-Arguments
18.Install additional required components ?
Install additional required components ?当然是选择
Install
了,昨晚电脑休眠,今早打开发现iTunes升级了,再次打开xcode就出现了这个情况
19.UIColor赋值溢出问题
UIColorBreakForOutOfRangeColorComponents
所以你需要打一个这样条件的断点去调试
福利:上面那个是布局问题打的断点stackoverflow
20.约束问题的断点调试(上图有)
UIViewAlertForUnsatisfiableConstraints
[kRootViewController.view drawViewHierarchyInRect:self.bounds afterScreenUpdates:afterUpdates];
kRootViewController
是根视图的一个宏定义,在drawViewHierarchyInRect:afterScreenUpdates:
方法里crash我在stackoverflow上找到了解决方案
需要判断一下她的superview
或者window
是否为nil
;
stackoverflow上描述的会更清楚一些
21xcode 9
提交审核时需要1024*1024的图片 logo
WARNING ITMS-90704: "Missing Marketing Icon. iOS Apps must include a 1024x1024px Marketing Icon in PNG format. Apps that do not include the Marketing Icon cannot be submitted for App Review or Beta App Review."
以前在工程里没有这个尺寸的 Icon 最好添加一下吧😊
22.xcode 9
xib
Safe Area Layout Guide Before iOS 9.0
Xcode 9.0 里的一个xib 出现了这个问题
CSDN上找到了解决方案
23.[This generally means that another instance of this process was already running or is hung in the debugger.]
Hardware ->Restart24.The request was denied by service delegate (SBMainWorkspace) for reason:
重启模拟器不行?是不是勾选了下面这个,如果没有用到的话话取消勾选就可以了
取消勾选
25 Warning: Multiple build commands for output /.../...
更新第三方 SDK 文件覆盖后出现这个问题,删除重复的就 OK 了
参考地址
26 Xcode 10 中 Multiple commands produce……
1 情况一
:-1: Multiple commands produce '/Users/***/Library/Developer/Xcode/DerivedData/TeSt-hjlyjwcmyontcqfoyyuqxiupqzqn/Build/Products/Debug-iphonesimulator/TeSt.app':
1) Target 'TeSt' has create directory command with output '/Users/***/Library/Developer/Xcode/DerivedData/TeSt-hjlyjwcmyontcqfoyyuqxiupqzqn/Build/Products/Debug-iphonesimulator/TeSt.app'
2) That command depends on command in Target 'TeSt': script phase “[CP] Copy Pods Resources”
工程应该是生成output
文件里
命令的问题出在Copy Pods Resources
里
解决方法找到工程的target
→Build Phases
→Copy Pods Resources
→Output Files
移除
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}
2 情况二
:-1: Multiple commands produce '/Users/***/Library/Developer/Xcode/DerivedData/TeSt-hjlyjwcmyontcqfoyyuqxiupqzqn/Build/Products/Debug-iphonesimulator/TeSt.app/Info.plist':
1) Target 'TeSt' (project 'TeSt') has copy command from '/Users/***/Desktop/TeSt/TeSt/Vendor/FBKVOController/Info.plist' to '/Users/***/Library/Developer/Xcode/DerivedData/TeSt-hjlyjwcmyontcqfoyyuqxiupqzqn/Build/Products/Debug-iphonesimulator/TeSt.app/Info.plist'
2) Target 'TeSt' (project 'TeSt') has process command with output '/Users/***/Library/Developer/Xcode/DerivedData/TeSt-hjlyjwcmyontcqfoyyuqxiupqzqn/Build/Products/Debug-iphonesimulator/TeSt.app/Info.plist'
1 在 Xcode里, 选择 File->Project/Workspace settings.
2 build system → Legacy Build system.
27Xcode解决警告“ld: warning: directory not found for option”
删除了引用文件的原因,在以下路径删掉编译报warning的路径
targets--build settings--Library Search Paths 和Framework Search Paths