FBProfilePictureView对象不会显示图像 [英] FBProfilePictureView object won't show image

查看:157
本文介绍了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文件要求在成功完成连接之前已经加载了类型。
// http://stackoverflow.com/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.
// http://stackoverflow.com/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对象不会显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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