Я использую clang для компиляции своего кода, но я получаю ошибку, код и ошибка следующие:
/Users/fenglihai/llvm/llvm_build/Debug/bin/ClangConfuse /Users/fenglihai/Desktop/Test/Test/ITXAppdelegate.m /Users/fenglihai/Desktop/Test/Test/main.m /Users/fenglihai/Desktop/Test/Test/MainViewController.m /Users/fenglihai/Desktop/Test/Test/VTEnumType.h /Users/fenglihai/Desktop/Test/Test/ITXAppdelegate.h /Users/fenglihai/Desktop/Test/Test/MainViewController.h -- -w -std=gnu11 -fobjc-abi-version=2 -Wnullability-completeness -Wno-arc-repeated-use-of-weak -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -isystem /Users/fenglihai/llvm/llvm_build/Debug/lib/clang/9.0.0/include -Wnull-dereference -fobjc-weak -ObjC -mios-simulator-version-min=8.0 -ObjC -lSDWebImage -lSVProgressHUD -lYYCache -lYYCategories -lc++ -ljcore-ios-1.2.6 -ljpush-ios-3.1.2 -lpop -lresolv -lsqlite3 -lz -framework Accelerate -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreImage -framework CoreTelephony -framework CoreText -framework Foundation -framework ImageIO -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -weak_framework UserNotifications -I/Users/fenglihai/Desktop/Test/Test -I/Users/fenglihai/Desktop/Test/Test -I/Users/fenglihai/Desktop/Test/Test -I/Users/fenglihai/Desktop/Test/Pods/Headers/Public -I/Users/fenglihai/Desktop/Test/Pods/Headers/Public/JPush -I/Users/fenglihai/Desktop/Test/Pods/Headers/Public/SDWebImage -I/Users/fenglihai/Desktop/Test/Pods/Headers/Public/SVProgressHUD -I/Users/fenglihai/Desktop/Test/Pods/Headers/Public/YYCache -I/Users/fenglihai/Desktop/Test/Pods/Headers/Public/YYCategories -I/Users/fenglihai/Desktop/Test/Pods/Headers/Public/pop
я получаю ошибку:
/Users/fenglihai/Desktop/Test/Test/VTEnumType.h:13:44: error: function definition declared 'typedef'
typedef NS_ENUM(NSUInteger, VTLayoutStyle) {
^
/Users/fenglihai/Desktop/Test/Test/VTEnumType.h:15:5: error: use of undeclared identifier 'VTLayoutStyleDefault'
VTLayoutStyleDefault,
^
/Users/fenglihai/Desktop/Test/Test/VTEnumType.h:17:5: error: use of undeclared identifier 'VTLayoutStyleDivide'; did you mean 'VTLayoutStyle'?
VTLayoutStyleDivide,
^~~~~~~~~~~~~~~~~~~
VTLayoutStyle
/Users/fenglihai/Desktop/Test/Test/VTEnumType.h:13:29: note: 'VTLayoutStyle' declared here
typedef NS_ENUM(NSUInteger, VTLayoutStyle) {
^
/Users/fenglihai/Desktop/Test/Test/VTEnumType.h:19:5: error: use of undeclared identifier 'VTLayoutStyleCenter'; did you mean 'VTLayoutStyle'?
VTLayoutStyleCenter,
^~~~~~~~~~~~~~~~~~~
VTLayoutStyle
/Users/fenglihai/Desktop/Test/Test/VTEnumType.h:13:29: note: 'VTLayoutStyle' declared here
typedef NS_ENUM(NSUInteger, VTLayoutStyle) {
^
4 errors generated.
Error while processing /Users/fenglihai/Desktop/Test/Test/VTEnumType.h.
VTEnumType.h
#ifndef VTEnumType_h
#define VTEnumType_h
/** 导航栏布局样式 */
typedef NS_ENUM(NSUInteger, VTLayoutStyle) {
/** 默认样式,item自适应文本宽度,间距由itemSpacing决定 */
VTLayoutStyleDefault,
/** items等分导航条宽度,常用于item数较少时 */
VTLayoutStyleDivide,
/** 导航栏居中布局,间距由itemSpacing决定 */
VTLayoutStyleCenter,
};
#endif /* VTEnumType_h */
ITXAppdelegate.m
#import "ITXAppdelegate.h"
#import "VTEnumType.h"
@interface ITXAppdelegate ()
@property (nonatomic, assign) VTLayoutStyle height;
@end
@implementation ITXAppdelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.height =VTLayoutStyleDefault ;
return YES;
}
@end