Should I fix Xcode 5 'Semantic issue: undeclared selector'?

后端 未结 4 813
醉梦人生
醉梦人生 2020-12-14 01:32

I\'m trying to upgrade my app with Xcode5 but encountered a number of \'Semantic issues\' in a third party library (being MagicalRecord). The quickest way to \'fix\' this mi

4条回答
  •  春和景丽
    2020-12-14 01:59

    You just need to declare a class or protocol that contains the selector. For example:

    //  DeliveryTimeComparison.h
    #import 
    
    @protocol DeliveryTimeComparison 
    
    - (void)compareByDeliveryTime:(id)otherTime;
    
    @end
    

    And then simply #import "DeliveryTimeComparison.h" in any class where you plan to use @selector(compareByDeliveryTime:).

    Or alternatively, just import the class header for any object that contains a "compareByDeliveryTime:" method.

提交回复
热议问题