2014-02-06 36 views
1

我只在日常視圖上製作日曆,只是做完了,嘗試測試應用程序試圖運行它,但我保留語義錯誤1爲紅色,黃色爲3。非整型「UIViewAnimationOptions」(又名'enum UIViewAnimationOptions')是一個無效的基礎類型

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/[email protected]) 

    { 
    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

枚舉值必須是整數類型。雖然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 
+0

感謝試圖幫助,但沒有工作,我嘗試過了,我現在甚至不能接近的Xcode,我必須強制退出它, – user3281050

相關問題