FBConnect - 模板不使用我的模板包
我为我的应用程序注册了一个模板包,它只使用 *actor*,所以我像这样提出它:(
FBFeedDialog* dialog = [[[FBFeedDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.templateBundleId = 12345;
[dialog show];
当然使用我的包 ID)
但是当对话框出现时我得到的只是“你想发布吗?”这个故事到你的个人资料吗?”。 “故事”不会出现在对话框中,如果我单击“发布”,我的提要中最终会出现一个空白故事。
然后我尝试注册另一个,其中 a) 只有单行故事,以使事情更简单(第一个拥有一切)和 b) 使用自定义密钥。
FBFeedDialog* dialog = [[[FBFeedDialog alloc] init] autorelease];
dialog.templateBundleId = 12345;
dialog.templateData = @"{\"flavor\": \"chocolate chip\"}";
[dialog show];
同样的结果,空白的故事。我已经做了很多谷歌搜索,但找不到其他人遇到这个问题,所以我一定做了一些非常愚蠢的事情。有人可以建议吗?
I registered a template bundle for my app, one that only uses *actor*, so I brought it up like this:
FBFeedDialog* dialog = [[[FBFeedDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.templateBundleId = 12345;
[dialog show];
(using my bundle id, of course)
But all I get when the dialog comes up is "Do you want to publish this story to your Profile?". The "story" doesn't show up in the dialog, and if I click Publish I end up with a blank story in my feed.
Then I tried registering another one which a) has only a one-line story, to make things simpler (the first one had everything) and b) uses a custom key.
FBFeedDialog* dialog = [[[FBFeedDialog alloc] init] autorelease];
dialog.templateBundleId = 12345;
dialog.templateData = @"{\"flavor\": \"chocolate chip\"}";
[dialog show];
Same result, blank story. I've done a lot of google searching and can't find anyone else with this problem, so I must be doing something incredibly silly. Can anyone advise, please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我修复了它,但我不太理解修复(我是 Obj-C 和 iPhone 的新手)。
我有一个名为 session 的 ivar,它存储 FBConnect 会话,为此我像往常一样有一个 @property 和 @synthesize 。我删除了这两个内容,并在分配会话时显式保留会话,而不是依赖属性来执行此操作,并且它开始工作。我不明白它们在功能上有何不同,但在将我的代码与有效的示例进行比较时,我注意到了这种差异并尝试了它。释放是在 dealloc 方法中进行的,这也是它一直存在的地方。
如果有人能给出一个解释,我希望得到一个解释!
I fixed it, but I don't quite understand the fix (I'm new to Obj-C as well as iPhone).
I have an ivar called session, which stores the FBConnect session, for which I had an @property and @synthesize as usual. I removed both of those and explicitly retained the session when it was allocated, instead of relying on the property to do it, and it started working. I don't see how these are functionally different, but in comparing my code to the sample, which worked, I noticed this difference and tried it. The release is in the dealloc method, which is where it was all along.
I would love an explanation if anyone can give one!