我有一个NSMutableArray填充类型为“GameObject”的对象。 GameObject有许多属性,其中之一是“gameObjectType”。 “gameObjectType”的类型是GameObjectTypeEnum。我想能够过滤这个NSMutableArray,所以只返回某种类型的GameObjects。我有到位以下,但它给了我一个“BAD访问”错误:基于枚举属性过滤NSMutableArray
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"gameObjectType = %@", gameObjectType];
return [gameObjects filteredArrayUsingPredicate:predicate];
是否有可能通过“自定义”类型(即,此枚举我定义)到predicateWithFormat呼叫?
铸造到int和使用%d给了我我需要的!谢谢。 – Marty 2010-06-13 19:29:19