我一直用swift构建一个应用程序,在github上使用MWPhotoBrowser
库,但我在Xcode中有很多错误,这就是我所做的:
1-创建了一个快速项目。
2-链接二进制文件库
2.1- UIKit,Foundation,AssetsLibrary,MediaPlayer,QuartzCore,CoreGrahpics,ImageIO。
3-我手动导入了以下库:
3.1- SDWebImage,MWPhotoBrowser,MBProgressHUD,DACircularProgress。
这应该足以满足MWPhotoBrowser的先决条件。 在没有添加桥接头的情况下,我有27个错误。
CompileC /Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Intermediates/PhotoBrowser2.build/Debug-iphoneos/PhotoBrowser2.build/Objects-normal/arm64/MWTapDetectingImageView.o PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/Node-B/Desktop/PhotoBrowser2
export LANG=en_US.US-ASCII
export 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/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-cache-path=/Users/Node-B/Library/Developer/Xcode/DerivedData/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/Node-B/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -miphoneos-version-min=8.4 -iquote /Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Intermediates/PhotoBrowser2.build/Debug-iphoneos/PhotoBrowser2.build/PhotoBrowser2-generated-files.hmap -I/Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Intermediates/PhotoBrowser2.build/Debug-iphoneos/PhotoBrowser2.build/PhotoBrowser2-own-target-headers.hmap -I/Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Intermediates/PhotoBrowser2.build/Debug-iphoneos/PhotoBrowser2.build/PhotoBrowser2-all-target-headers.hmap -iquote /Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Intermediates/PhotoBrowser2.build/Debug-iphoneos/PhotoBrowser2.build/PhotoBrowser2-project-headers.hmap -I/Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Products/Debug-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Intermediates/PhotoBrowser2.build/Debug-iphoneos/PhotoBrowser2.build/DerivedSources/arm64 -I/Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Intermediates/PhotoBrowser2.build/Debug-iphoneos/PhotoBrowser2.build/DerivedSources -F/Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Products/Debug-iphoneos -MMD -MT dependencies -MF /Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Intermediates/PhotoBrowser2.build/Debug-iphoneos/PhotoBrowser2.build/Objects-normal/arm64/MWTapDetectingImageView.d --serialize-diagnostics /Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Intermediates/PhotoBrowser2.build/Debug-iphoneos/PhotoBrowser2.build/Objects-normal/arm64/MWTapDetectingImageView.dia -c /Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m -o /Users/Node-B/Library/Developer/Xcode/DerivedData/PhotoBrowser2-gshddfhrhixnczafndhdvrizdbiz/Build/Intermediates/PhotoBrowser2.build/Debug-iphoneos/PhotoBrowser2.build/Objects-normal/arm64/MWTapDetectingImageView.o
In file included from /Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:9:
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.h:13:38: error: cannot find interface declaration for 'UIImageView', superclass of 'MWTapDetectingImageView'
@interface MWTapDetectingImageView : UIImageView {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.h:23:20: error: expected a type
- (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch;
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.h:23:63: error: expected a type
- (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch;
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.h:24:20: error: expected a type
- (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch;
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.h:24:63: error: expected a type
- (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch;
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.h:25:20: error: expected a type
- (void)imageView:(UIImageView *)imageView tripleTapDetected:(UITouch *)touch;
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.h:25:63: error: expected a type
- (void)imageView:(UIImageView *)imageView tripleTapDetected:(UITouch *)touch;
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:13:22: error: expected a type
- (id)initWithFrame:(CGRect)frame {
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:20:22: error: expected a type
- (id)initWithImage:(UIImage *)image {
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:27:22: error: expected a type
- (id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage {
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:27:56: error: expected a type
- (id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage {
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:34:50: error: expected a type
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:53:26: error: expected a type
- (void)handleSingleTap:(UITouch *)touch {
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:58:26: error: expected a type
- (void)handleDoubleTap:(UITouch *)touch {
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:63:26: error: expected a type
- (void)handleTripleTap:(UITouch *)touch {
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:14:15: error: 'MWTapDetectingImageView' cannot use 'super' because it is a root class
if ((self = [super initWithFrame:frame])) {
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:15:8: error: property 'userInteractionEnabled' not found on object of type 'MWTapDetectingImageView *'
self.userInteractionEnabled = YES;
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:21:15: error: 'MWTapDetectingImageView' cannot use 'super' because it is a root class
if ((self = [super initWithImage:image])) {
^
/Users/Node-B/Desktop/PhotoBrowser2/PhotoBrowser2/MWPhotoBrowser/Pod/Classes/MWTapDetectingImageView.m:22:8: error: property 'userInteractionEnabled' not found on object of type 'MWTapDetectingImageView *'
self.userInteractionEnabled = YES;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
我在github上传了我的项目:https://github.com/AaoIi/PhotoBrowser_2
答案 0 :(得分:0)
如果您已经添加了所需的所有框架,那么您只需要基本上添加
#import <Foundation/Foundation.h>
#import <MediaPlayer/MediaPlayer.h>
#import <QuartzCore/QuartzCore.h>
#import <CoreGraphics/CoreGraphics.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <ImageIO/ImageIO.h>
#import <UIKit/UIKit.h>
到MWPhotoBrowser文件夹中的所有.h文件
对于其他框架,如果您手动导入它们,则需要更改
#import <DACircularProgressView/DACircularProgressView.h>
到
#import "DACircularProgressView.h"
在调用m文件中,为MBProgressHUD,DACircularProgress和SDWebImage文件执行此操作