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

查看:17
本文介绍了FBProfilePictureView 对象不会显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

这是 iboutlet 的代码

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

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

self.useProfileImage.profileID = user.id;

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

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

<块引用>

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

并通过添加 [FBProfilePictureView class]; 按照 FB 教程建议的方式解决了它到应用程序委托中的applicationdidfinishlaunching:withoptions".

知道为什么图片不显示吗?

教程链接

解决方案

添加 [FBProfilePictureView class]; 作为 didFinishLaunching 的应用程序委托方法的第一行对我来说似乎有点 hacky.p>

查看 SDK 中的 HelloFacebookSample.这是 4 行注释:

//如果没有添加 -ObjC 链接器标志,可能需要取消注释以下行,因为//Nib 文件需要先加载类型,然后才能成功进行连线.//http://stackoverflow.com/questions/1725881/unknown-class-myclass-in-interface-builder-file-error-at-runtime//[FBProfilePictureView 类];

我尝试添加 -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天全站免登陆