Multiple methods named “count” found with mismatched result, parameter type or attributes

后端 未结 6 2120
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-19 04:10

Since the update to Xcode 5.1 I can\'t archive my project any more. Xcode always says \"Multiple methods named \"count\" found with mismatched result, parameter type or attr

6条回答
  •  無奈伤痛
    2020-12-19 04:29

    In case you don't want to write code like this [((NSArray*)aId) count]:

    @interface NSArray ()
    - (NSUInteger) arrayElementCount;
    @end
    
    @implementation NSArray()
    - (NSUInteger) arrayElementCount {
        return [self count];
    }
    @end
    

    Using arrayElementCount instead of 'count'

提交回复
热议问题