我有一个 profileviewcontroller,其中这些 ImageView 主要是为了获取个人资料图片。但是在我的 profileviewController.m 的开头,它声明“未知类型名称‘PFImageView’;你是说‘UIImageview’吗?”对于以下行:
@property (strong, nonatomic) PFImageView *imageUser;
如果用户要添加他的个人资料照片,我会得到完全相同的照片:
-(void)addProfilePic
{
//---------------------------------------------------------------------------------------------------------------------------------------------
imageUser = [[PFImageView alloc] initWithFrame:CGRectMake(([UIScreen mainScreen].bounds.size.width-100)/2, 50, 100, 100)];
我不想一定要更改为 UIImageView,认为它可能会弄乱代码中的其他内容,所以想澄清一下。我还有一个 ARC 语义问题,涉及“'UIImageView' 的不可见@interface 声明选择器'setFile。'”和“'UIImageView' 的不可见@interface 声明选择器'loadInBackground。'”这在我的呼吁中头像:
-(void)getProfilePicture
{
PFUser *user = [PFUser currentUser];
NSLog(@"file--%@",[user objectForKey:PF_USER_PICTURE]);
userName = user[PF_USER_USERNAME];
status = user[PF_USER_STATUS];
if ([user objectForKey:PF_USER_PICTURE]) {
[imageUser setFile:[user objectForKey:PF_USER_PICTURE]];
[imageUser loadInBackground];
}
else{
imageUser.image = [UIImage imageNamed:@"blank_profile@2x.png"];
}
// fieldName.text = user[PF_USER_FULLNAME];
}
非常感谢您的帮助,感谢您的宝贵时间。
最佳答案
将 ParseUI FrameWork 导入您的项目。
#import <ParseUI/ParseUI.h>
将上面的行导入到你想要使用PFImageView的头文件中
关于ios - ARC 语义问题 : "No visible @interface for UIImageView" and PFImageView Semantic Issues,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27776480/