tags:

views:

267

answers:

1

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?

A: 

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!

Janine