FBProfilePictureView对象不会显示图像

Yoa*_*rtz 13 profile sdk facebook ios

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

这是iboutlet的代码

@property (strong, nonatomic) IBOutlet FBProfilePictureView *useProfileImage;
Run Code Online (Sandbox Code Playgroud)

这是我用来显示图片的内容

self.useProfileImage.profileID = user.id;
Run Code Online (Sandbox Code Playgroud)

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

当我第一次运行项目时,我遇到了这个错误

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

并通过添加[FBProfilePictureView class]; 到app delegate中的"applicationdidfinishlaunching:withoptions"来解决FB教程建议的方式.

任何想法为什么图片不会显示?

链接到教程

Chr*_*ory 21

添加[FBProfilePictureView class];作为didFinishLaunching的app委托方法的第一行似乎有点hacky给我.

查看SDK中的HelloFacebookSample.这是4行评论:

// 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];
Run Code Online (Sandbox Code Playgroud)

我尝试添加-ObjC标志,它工作正常.