我在日常视图上制作一个日历只是刚刚完成并尝试测试应用程序我试图运行它但我不断得到红色和黄色3的语义错误。
RACSignal+RCLAnimationAdditions.h
Non-integral type 'UIViewAnimationOptions' (aka 'enum UIViewAnimationOptions') is an invalid underlying type
我的代码似乎是正确的,但我错过了什么?
......和另一个问题:依赖性分析警告。
这是第一个错误:
RACSignal+RCLAnimationAdditions.h
Non-integral type 'UIViewAnimationOptions' (aka 'enum UIViewAnimationOptions') is an invalid underlying type
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
typedef enum : UIViewAnimationOptions {
RCLAnimationCurveDefault = 0,
RCLAnimationCurveEaseInOut = UIViewAnimationOptionCurveEaseInOut,
RCLAnimationCurveEaseIn = UIViewAnimationOptionCurveEaseIn,
RCLAnimationCurveEaseOut = UIViewAnimationOptionCurveEaseOut,
RCLAnimationCurveLinear = UIViewAnimationOptionCurveLinear
} RCLAnimationCurve;
#elif TARGET_OS_MAC
typedef enum : NSUInteger {
RCLAnimationCurveDefault,
RCLAnimationCurveEaseInOut,
RCLAnimationCurveEaseIn,
RCLAnimationCurveEaseOut,
RCLAnimationCurveLinear
} RCLAnimationCurve;
second code is error says (Assigning to 'id<EKEventEditViewDelegate>' from incompatible type 'SettingsViewController *const __strong') (Warning: Multiple build commands for output file /Users/amrhelweh/Library/Developer/Xcode/DerivedData/Daily-gpcmuomerezkqqfipezqguslloqz/Build/Products/Debug-iphonesimulator/Daily.app/Add.png)
(Warning: Multiple build commands for output file /Users/amrhelweh/Library/Developer/Xcode/DerivedData/Daily-gpcmuomerezkqqfipezqguslloqz/Build/Products/Debug-iphonesimulator/Daily.app/Add@2x.png)
{
EKEventEditViewController* vc = [[EKEventEditViewController alloc] init];
vc.eventStore = eventStore;
EKEvent* event = [EKEvent eventWithEventStore:eventStore];
// Prepopulate all kinds of useful information with you event.
event.title = @"";
event.startDate = [NSDate date];
event.endDate = [NSDate date];
event.URL = [NSURL URLWithString:@""];
event.notes = @"";
event.allDay = NO;
vc.event = event;
vc.editViewDelegate = self;
[self presentViewController:vc animated:YES completion:nil];
}
答案 0 :(得分:0)
枚举值必须是整数类型。虽然UIViewAnimationOptions
中的值属于NSUInteger
类型,但UIViewAnimationOptions
本身是枚举;因此,此处的代码尝试将RCLAnimationCurve
的值键入为枚举。你最好只使用NSUInteger:
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
typedef enum : NSUInteger {
RCLAnimationCurveDefault = 0,
RCLAnimationCurveEaseInOut = UIViewAnimationOptionCurveEaseInOut,
RCLAnimationCurveEaseIn = UIViewAnimationOptionCurveEaseIn,
RCLAnimationCurveEaseOut = UIViewAnimationOptionCurveEaseOut,
RCLAnimationCurveLinear = UIViewAnimationOptionCurveLinear
} RCLAnimationCurve;
#elif TARGET_OS_MAC
typedef enum : NSUInteger {
RCLAnimationCurveDefault,
RCLAnimationCurveEaseInOut,
RCLAnimationCurveEaseIn,
RCLAnimationCurveEaseOut,
RCLAnimationCurveLinear
} RCLAnimationCurve;
#endif