我将IKImageBrowserView的内容绑定到实现IKImageBrowserItem协议的对象Person的数组控制器:
– imageUID
– imageRepresentationType
– imageRepresentation在Person类中,我希望属性"photo“与属性"imageRepresentation”相同(添加该属性只是为了符合协议)。
到目前为止,我的解决方案是在Person init方法中绑定这两个属性。但是,我不喜欢有重复的属性,因为Person是一个模型类。
我该怎么做?(请记住,我希望保留名称photo,而不是imageRepresentation)
发布于 2012-01-17 06:33:55
由于imageRepresentation对于协议是必需的,但您希望使用photo属性,因此可以按以下方式实现该方法:
- (id)imageRepresentation {
return self.photo
} 通过这种方式,您可以满足协议的要求,但只使用photo。
https://stackoverflow.com/questions/6557759
复制相似问题