接收错误Interface Builder文件中的未知类PFImageView进行解析 [英] receiving error Unknown class PFImageView in Interface Builder file for parse

查看:68
本文介绍了接收错误Interface Builder文件中的未知类PFImageView进行解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过以下方式设置pfimage视图情节提要:

I attempted to setup pfimage view storyboards in the following manner:

我拖动了一个UIImageView,然后将其类标识更改为PFImageView.

I dragged a UIImageView and then changed its class identity to PFImageView.

然后我将其拖动以在.h文件中创建一个出口.

Then I dragged it to create an outlet in my .h file.

@property (strong, nonatomic) IBOutlet PFImageView *BuyPetImage;

然后在该类的加载时,我使用与属性相同的名称访问imageview并设置其文件属性.

Then on my on load for the class I access imageview with the same name as the property and set its file property.

- (void)viewDidLoad {
    [super viewDidLoad];

    // Do any additional setup after loading the view.
    PFObject *petdataobj = [selectedPet objectForKey:@"petObject"];
    self.BuyPetNameLabel.text = [petdataobj objectForKey:@"Name"];
    self.BuyPetTypeLabel.text = [petdataobj objectForKey:@"Type"];

    self.BuyPetImage.file= [selectedPet objectForKey:@"imageFile"];
    [self.BuyPetImage loadInBackground];
}

当视图加载时,出现以下错误:

When the view loads I get the following error:

Interface Builder文件中的未知类PFImageView. -[UIImageView setFile:]:无法识别的选择器已发送到实例0x1cdb52f0 * 由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[UIImageView setFile:]:无法识别的选择器发送到实例0x1cdb52f0'

Unknown class PFImageView in Interface Builder file. -[UIImageView setFile:]: unrecognized selector sent to instance 0x1cdb52f0 * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setFile:]: unrecognized selector sent to instance 0x1cdb52f0'

有人知道为什么会这样吗?

Does anyone know why this is happening?

推荐答案

我无法解决这个问题,所以我最终只用代码创建了PFImageView. Anypic项目中有几个示例.我想弄清楚这个问题的原因以及如何解决这个问题,但是现在通过代码来解决这个问题.

I couldn't get around this problem so I ended up just creating the PFImageView entirely in code. There's a couple examples of this in the Anypic project. I would like to figure out the cause of this problem and how to resolve it, but for now doing it in code allows me to get around it.

这篇关于接收错误Interface Builder文件中的未知类PFImageView进行解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆