錯(cuò)題集

1.使用CocoaPods時(shí)出現(xiàn)重新寫了一了 Podfile 文件:

3140363C-E163-4122-A75B-DD21AE4E4A33.png

刪除命令:

rm -rf .Podfile.swp

點(diǎn)我看地址

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

點(diǎn)我看地址

5.ARC&MRC混編

MRC修改為可編譯的ARC文件

解決方法:
1.MRC修改為可編譯的ARC文件時(shí)添加[-fno-objc-arc]
2.ARC修改為可編譯的MRC文件時(shí)添加[-fobjc-arc]

6.請(qǐng)求數(shù)據(jù)返回狀態(tài)碼[NSCFNumber][NSString]比較

返回的狀態(tài)碼進(jìn)行判斷

[responseObject[@"status"]]就是需要比較的返回值
解決方法:

        NSString *tempStr = [NSString stringWithFormat:@"%@",responseObject[@"status"]];
        if ([tempStr isEqualToString:@"1"]) {
}
[responseObject[@"status"] isEqualToNumber:[NSNumber numberWithInt:1]]

[responseObject[@"status"] isEqualToNumber:@1]

7.開發(fā)中自己命名的類和系統(tǒng)中重復(fù)時(shí)會(huì)提示

Message is implemented in both XXX文件和XXX文件
One of the two will be used. Which one is undefined.

解決方法:
在開發(fā)過程中難免會(huì)出現(xiàn)這種情況,在[stackoverflow]網(wǎng)站有解決方案[csdn]網(wǎng)站上中文解釋
不過,我沒有成功,而是重新命名了,感覺很酸爽

8.本地?cái)?shù)據(jù)沒有同步到服務(wù)器上導(dǎo)致模擬機(jī)測(cè)試正常,真機(jī)測(cè)試失敗

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.也有可能在其他問題上出現(xiàn)這個(gè)警告,挖個(gè)坑先

9.[@class]問題

ChartView為自定義的視圖

解決方法:
將上面的注掉的去掉就可以了關(guān)于[@class]相關(guān)參考

@class ChartView;

10.[Undefined symbols for architecture i386]

在使用第三方登陸的時(shí)候,調(diào)用[TencentOpenAPI]報(bào)錯(cuò)

Undefined symbols for architecture i386

解決方法:

并沒有解決,啊哈哈哈哈哈哈哈

不過,在這里好像有點(diǎn)意思,相關(guān)參考

11. 真機(jī)測(cè)試[Unsupported device model]

“(null)” is of a model that is not supported by this version of Xcode. Please use a different device.

運(yùn)行時(shí)出現(xiàn)?+R

Cannot (null) '項(xiàng)目名字'.

clean時(shí)出現(xiàn)?+SHIFT+K

解決方法:

重啟Xcode就可以了,??????

12.warning: Missing file: XXX is missing from working copy 警告錯(cuò)誤解決

解決方案:
相關(guān)參考

13. duplicate interface definition for class ""

重復(fù)引入文件
解決方案:

找到重復(fù)的文件/文件夾,直接刪除

14.is missing from working copy

我的是在git 情況下出現(xiàn)的問題
其實(shí)你的文件已經(jīng)丟失.是無法cd 到你的那個(gè)文件下的
所以,應(yīng)該是cd到你的工程下,再執(zhí)行g(shù)it 命令才行

git rm 丟失的文件路徑

如果你太多的警告是在同由于同一個(gè)文件夾的丟失可以直接刪除文件夾,其實(shí)就是批量刪除,執(zhí)行命令如下:

git rm -m 丟失的文件夾名字

解決方案:
相關(guān)參考

15播放一段自定義音效初現(xiàn)問題

音頻的路徑不對(duì)把要播放的音頻放在TARGETS - Build Phases -Copy Bundle Resources里

    /**
     * inFileUrl:音頻文件url
     * outSystemSoundID:聲音id(此函數(shù)會(huì)將音效文件加入到系統(tǒng)音頻服務(wù)中并返回一個(gè)長整形ID)
     */
    AudioServicesCreateSystemSoundID((__bridge CFURLRef)(url), &soundID);

上面這段代碼崩潰是因?yàn)槲业娜謹(jǐn)帱c(diǎn)條件設(shè)置不對(duì).

將斷點(diǎn)條件由``All``改為``Object-C``

相關(guān)參考

15 自定義靜態(tài)變量static加入const出現(xiàn)警告

Sending 'const NSString *__strong' to parameter of type 'NSNotificationName _Nonnull' (aka 'NSString *') discards qualifiers
自定義字符串
static  const NSString *name = @"wtf";

static NSString *const  name = @"wtf";

解釋:前者相當(dāng)于指針本身不可修改,后者表示指針指向的內(nèi)容不可修改,兩者的作用都是使firstString只可讀不可寫。
相關(guān)參考

16TableView補(bǔ)全分割線

//實(shí)現(xiàn)下面的代理方法即可tableview 分割線補(bǔ)全
-(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.打印數(shù)據(jù)很多

OS_ACTIVITY_MODE disable
Run-Arguments

18.Install additional required components ?

Install additional required components ?

當(dāng)然是選擇Install了,昨晚電腦休眠,今早打開發(fā)現(xiàn)iTunes升級(jí)了,再次打開xcode就出現(xiàn)了這個(gè)情況

19.UIColor賦值溢出問題

UIColorBreakForOutOfRangeColorComponents

所以你需要打一個(gè)這樣條件的斷點(diǎn)去調(diào)試

福利:上面那個(gè)是布局問題打的斷點(diǎn)

stackoverflow

20.約束問題的斷點(diǎn)調(diào)試(上圖有)

UIViewAlertForUnsatisfiableConstraints

[kRootViewController.view drawViewHierarchyInRect:self.bounds afterScreenUpdates:afterUpdates];

kRootViewController是根視圖的一個(gè)宏定義,在drawViewHierarchyInRect:afterScreenUpdates:方法里crash我在stackoverflow上找到了解決方案
需要判斷一下她的superview或者window是否為nil;
stackoverflow上描述的會(huì)更清楚一些

21xcode 9提交審核時(shí)需要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."

以前在工程里沒有這個(gè)尺寸的 Icon 最好添加一下吧??

22.xcode 9 xib Safe Area Layout Guide Before iOS 9.0

Xcode 9.0 里的一個(gè)xib 出現(xiàn)了這個(gè)問題
CSDN上找到了解決方案

23.[This generally means that another instance of this process was already running or is hung in the debugger.]

Hardware ->Restart

24.The request was denied by service delegate (SBMainWorkspace) for reason:

重啟模擬器不行?

是不是勾選了下面這個(gè),如果沒有用到的話話取消勾選就可以了


取消勾選

25 Warning: Multiple build commands for output /.../...

更新第三方 SDK 文件覆蓋后出現(xiàn)這個(gè)問題,刪除重復(fù)的就 OK 了

image.png

參考地址

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”

工程應(yīng)該是生成output文件里
命令的問題出在Copy Pods Resources
解決方法找到工程的targetBuild PhasesCopy Pods ResourcesOutput 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解決警告“l(fā)d: warning: directory not found for option”

刪除了引用文件的原因,在以下路徑刪掉編譯報(bào)warning的路徑

targets--build settings--Library Search Paths 和Framework Search Paths

參考地址

28 note: please rebuild precompiled header

重新clean一下工程,然后編譯。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容