FBProfilePictureView 对象不会显示图像

编程入门 行业动态 更新时间:2024-10-24 12:27:55
本文介绍了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 文件需要先加载类型,然后才能成功进行连线.//stackoverflow/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. // 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:54:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219934.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像   对象   FBProfilePictureView

发布评论

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

>www.elefans.com

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