在用于解析的接口生成器文件中接收错误未知类 PFImageView [英] receiving error Unknown class PFImageView in Interface Builder file for parse

查看:19
本文介绍了在用于解析的接口生成器文件中接收错误未知类 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;

然后在加载类时,我访问与属性同名的图像视图并设置其文件属性.

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.

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

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