非整数类型'UIViewAnimationOptions'(又名'enum UIViewAnimationOptions')是无效的基础类型

时间:2014-02-06 19:34:36

标签: ios objective-c xcode xcode5 objective-c++

我在日常视图上制作一个日历只是刚刚完成并尝试测试应用程序我试图运行它但我不断得到红色和黄色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];
}

1 个答案:

答案 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