Xcode編繹出錯問題解決歸類

WintonTalks發表於2016-01-05
  1. Choose a destination with a supported architecture in order to run on this device.  

     


    解決:

    Target -> Build Settings -> Build Options set the "Compiler for C/C++/Objective-C" -   選擇"Default compiler (Apple LLVM 5.0)"

     




    2.clang: error: invalid deployment target for -stdlib 
    解決:

     



    3.ios使用AdMob出錯-[GADObjectPrivate changeState:]: unrecognized selector sent
    解決:在Build Settings 中的Other Linker Flags中加入-ObjC


    4.'Undefined symbols for architecture i386:
    _OBJC_CLASS_$_Reachability", referenced  from objc-class-ref inViewController.o
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)'

    解決:問題原因:我xcode版本為4.5.1,在引入Reachability時候,4.5.1預設沒有勾選targert,所以導致上述錯誤。


    5.ios6.0 storyboard編繹出錯:'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate

    解決:storyboard or XIB tonot use Autolayout


    6.使用SDWebImage 第三方庫出錯
    Undefined symbols for architecture i386: "_OBJC_CLASS_$_MKAnnotationView", referenced from: l_OBJC_$_CATEGORY_MKAnnotationView_$_WebCache in MKAnnotationView+WebCache.o "_CGImageSourceCreateIncremental", referenced from: -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o "_CGImageSourceUpdateData", referenced from: -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o "_CGImageSourceCopyPropertiesAtIndex", referenced from: -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o "_CGImageSourceCreateImageAtIndex", referenced from: -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o "_kCGImagePropertyPixelHeight", referenced from: -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o "_kCGImagePropertyPixelWidth", referenced from: -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

    解決:加入 MapKit  和  ImageIO 



    7.錯誤提示:* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '* -[NSCFArray insertObject:atIndex:]: mutating method sent to immutable object'
    問題出現在語句:
    [saveArray addObject:[NSNumber numberWithInt:saveNum]];
    可變的方法傳送給一個不可變的物件

    ps:@property(nonatomic,retain) NSMutableArray * saveArray;
    前面已經賦值:

    NSMutableArray *array = [[NSMutableArray alloc] init];
    self.saveArray = array;
    [array release];



    解決方法:
    NSMutableArray *mutaArray = [[NSMutableArray alloc] init];
    [mutaArray addObjectsFromArray:saveArray];

    [mutaArray addObject:[NSNumber numberWithInt:saveNum]];

    self.saveArray = mutaArray
    [mutaArray release];






build 出現Dependency Analysis Error,Product.app出錯,解決方法   

build 出現Dependency Analysis Error,Product.app出錯,解決方法


Unable to run command ‘Cpresource  Product.app' - this target might include its own product.




  




解決方法:
TARGETS - Build Phases-Copy Bundle Resources-把Product.app刪掉


 

相關文章