Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @interface NSDictionary (dictionaryForClass)
- -(NSMutableDictionary *) dictionaryWithObjectsKindOfClass:(Class)myClass;
- @end
- @implementation NSDictionary (dictionaryForClass)
- -(NSMutableDictionary *) dictionaryWithObjectsKindOfClass:(Class)myClass;
- {
- NSMutableDictionary *ret = [[[NSMutableDictionary alloc] init] autorelease];
- for (id object in self) {
- if ([object isKindOfClass:myClass]) {
- [ret addObject:object];
- }
- }
- return ret;
- }
- @end
Add Comment
Please, Sign In to add comment