简体   繁体   中英

Compiler warnings with BlocksKit 1.8.1 / Xcode 4.5 / iOS

I'm getting warnings when using BlocksKit 1.8.1 in Xcode 4.5 with an iOS project.

The warning is:

在此处输入图片说明

And the details are:

GenerateDSYMFile /Users/john/Library/Developer/Xcode/DerivedData/AppName-epvlodroaifdsbacdbbxnlhuptrh/Build/Products/Debug-iphoneos/AppName.app.dSYM /Users/john/Library/Developer/Xcode/DerivedData/AppName-epvlodroaifdsbacdbbxnlhuptrh/Build/Products/Debug-iphoneos/AppName.app/AppName cd /Users/john/Documents/AppName_iphone setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/john/Library/Developer/Xcode/DerivedData/AppName-epvlodroaifdsbacdbbxnlhuptrh/Build/Products/Debug-iphoneos/AppName.app/AppName -o /Users/john/Library/Developer/Xcode/DerivedData/AppName-epvlodroaifdsbacdbbxnlhuptrh/Build/Products/Debug-iphoneos/AppName.app.dSYM

When compiling with device target.

When compiling with the simulator as target, the warnings are a bit different:

在此处输入图片说明

I've followed the instructions on the Git page:

  • Download a release of BlocksKit.
  • Move libBlocksKit.a and Headers to your project's folder, preferably a subfolder like "Vendor".
  • In "Build Phases", Drag libBlocksKit.a into your target's "Link Binary With Libraries" build phase.
  • In the build settings of your target or project, change "Other Linker Flags" to -ObjC -all_load. Make sure your app is linked with CoreGraphics, Foundation, MessageUI, and UIKit.
  • Change (or add) to "Header Search Paths" the relative path to BlocksKit's headers, like $(SRCROOT)/Vendor/Headers.
  • Insert #import ` in your project's prefix header.

What can be wrong?

I have the same warnings and couldn't find the reason but have found a temporary solution.

Maybe related:

There seem to be more problems with linking in BlocksKit 1.8.1: My app compiles and works correctly for development builds (although these warnings are shown). However, when I build an archive for Ad Hoc deployment, libBlocksKit is apparently not linked, as the app crashes when one of the BlocksKit methods is invoked with the following crash log:

Last Exception Backtrace:
0   CoreFoundation                  0x3b2783e2 __exceptionPreprocess + 158
1   libobjc.A.dylib                 0x3a2d195e objc_exception_throw + 26
2   CoreFoundation                  0x3b27bdbc +[NSObject(NSObject) doesNotRecognizeSelector:] + 180
3   CoreFoundation                  0x3b27a648 ___forwarding___ + 388
4   CoreFoundation                  0x3b1d2204 _CF_forwarding_prep_0 + 20

For all build configurations my other linker flags are set to -ObjC . (I dropped -all_load because this leads to a "duplicate symbols" with an AdMob library I'm using.)

Temporary solution:

I switched back to an older branch of BlocksKit: https://github.com/zwaldowski/BlocksKit and use linker flags -ObjC . This branch is deprecated but works for me without any of the above warnings for all build configurations.

Seems that it is a bug that will be fixed in the next release of BlocksKit:

https://github.com/pandamonia/BlocksKit/issues/108

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM