FBProfilePictureView对象不会显示图像

编程入门 行业动态 更新时间:2024-10-24 08:22:40
本文介绍了FBProfilePictureView对象不会显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在为3.1 iOS SDK做scrumptios facebook开发人员教程。 我设法从Facebook显示我的个人资料名称,但是FBProfilePictureView不显示图片

这里是iboutlet的代码

@property(强,非原子)IBOutlet FBProfilePictureView * useProfileImage;

这里是我用来显示图片

self.useProfileImage.profileID = user.id;

我已经确认它通过在标签中显示来更改图像的profileid变量。 / p>

当我第一次运行项目时出现此错误

2012-05 -18 04:04:11.620 Scrumptious [6548:f803] Interface Builder文件中的未知类 FBProfilePictureView。

和通过FB教程建议的方式解决了这个问题 - 将 [FBProfilePictureView类]; 添加到app delegate中的applicationdidfinishlaunching:withoptions。

知道图片无法显示的原因吗?

教程链接

解决方案

添加 [FBProfilePictureView类]; 作为didFinishLaunching的app委托方法的第一行似乎对我来说有点不好意思。

查看SDK中的HelloFacebookSample。以下是4行注释:

//如果尚未添加-ObjC链接器标志,则可能需要取消注释以下行是因为 // Nib文件要求在成功完成连接之前已经加载了类型。 // stackoverflow/questions/1725881/unknown-class-myclass-in-interface-builder-file-error-at-runtime // [FBProfilePictureView class];

我尝试添加 -ObjC 标志和它工作正常。

I'm doing the scrumptios facebook developer tutorial for the 3.1 iOS SDK. I've managed to display my profile name from facebook, however the FBProfilePictureView wont show the picture

here's the code for iboutlet

@property (strong, nonatomic) IBOutlet FBProfilePictureView *useProfileImage;

here is what I used to display the pic

self.useProfileImage.profileID = user.id;

I have confirmed that the it changed the profileid variable of the image by displaying it in a label.

When I first ran the project I had this error

"2012-05-18 04:04:11.620 Scrumptious[6548:f803] Unknown class FBProfilePictureView in Interface Builder file."

and solved it they way the FB tutorial suggested- by adding [FBProfilePictureView class]; to "applicationdidfinishlaunching: withoptions" in the app delegate.

any idea why the picture wouldn't show?

link to the tutorial

解决方案

Adding the [FBProfilePictureView class]; as the first line in the app delegate method of didFinishLaunching seems kinda hacky to me.

Check out the HelloFacebookSample inside the SDK. Here is the 4 line comment:

// If you have not added the -ObjC linker flag, you may need to uncomment the following line because // Nib files require the type to have been loaded before they can do the wireup successfully. // stackoverflow/questions/1725881/unknown-class-myclass-in-interface-builder-file-error-at-runtime // [FBProfilePictureView class];

I tried adding the -ObjC flag and it worked fine.

更多推荐

FBProfilePictureView对象不会显示图像

本文发布于:2023-07-27 02:55:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219936.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像   对象   FBProfilePictureView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!