- (instancetype)initPrivate
{
self = [super init];
if (self) {
_dictionary = [[NSMutableDictionary alloc] init];
}
return self;
}
- (void)setImage:(UIImage *)image forKey:(NSString *)key
{
[self.dictionary setObject:image forKey:key];
}
- (UIImage *)imageForKey:(NSString *)key
{
return [self.dictionary objectForKey:key];
}
我使用字典存储图像。我在setImage方法中遇到任何getImage方法的问题。