1

我想对类型的对象使用快速枚举id

基本上我在这里错过了支票:

id object = <get object form somewhere>;
if( <check if object implements fast enumeration> )
    for (id item in id<NSFastEnumeration>object)
        <process item>
4

1 回答 1

4

像这样的东西:

BOOL canBeFast = [yourCollection conformsToProtocol:@protocol(NSFastEnumeration)];
于 2011-05-23T22:18:33.707 回答