我有一个将其数据存储在字典中的容器类
我想枚举对象而不是键。
现在我有这样的代码
-(NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(__unsafe_unretained id [])buffer count:(NSUInteger)len
{
return [self.container countByEnumeratingWithState:state objects:buffer count:len]; // this isn't working as container is dictionary
}
-(myobject *)objectAtIndex:(int)number // this is the method to retrieve a specific object
{
int i = 0;
for(id key in self.container) {
if (number == i) {
id value = [self.container objectForKey:key];
return value;
}
else i++;
}
return nil;
}