objective c - Filtering NSMutableArray based on enum property -
I found an NSMutableArray filling with objects of type "game object". GameObject has many properties, one of which is "gameObjectType". "GameObjectType" type is of GameObjectTypeEnum. I want to be able to filter this NSMutableArray so that only a certain type of GameObjects is returned, I have found the following location, but it is giving me a "poor access" error:
NSPredicate * predicate = [NSPredicate predicateWithFormat: @ "gameObjectType =% @", gameObjectType]; Return [gameObjects filteredArrayUsingPredicate: predicate];
Is it possible to define this "custom" type (i.e., this enum I have defined)? Format call with format?
string format specifier % @
indicates an object, whereas you Integral values are passing. You probably want to type gameObjectType a int
and use the % d
specification. For more information, take a look at this
c प्रोग्रामिंग छोटे प्रोग्राम
ReplyDeleteफ़ंक्शन को दो int c नमूना कोड गुणा करने के लिए परिभाषित करें