[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

FBConnect facebook.stream.publish with NSDictionary problems

Asked by Cuahutleco in iPhone, Cocoa Programming Language, Miscellaneous Web Development

Tags: iphone, cocoa, objective-c, FBConnect, facebook

Hi,

I have this code that can't send a Facebook request until now.

I took this sample : http://forum.developers.facebook.com/viewtopic.php?pid=145965

But every time I run it, the console shows the following:

> *** -[NSCFArray dataUsingEncoding:]: unrecognized selector sent to instance
> 0x12fcb0 2009-10-30 13:54:27.758
> GeoPixr[307:207] *** Terminating app
> due to uncaught exception
> 'NSInvalidArgumentException', reason:
> '*** -[NSCFArray dataUsingEncoding:]:
> unrecognized selector sent to instance
> 0x12fcb0'


The [session resume] call returns TRUE.
 
Thanks in advance.
1:
2:
3:
4:
5:
6:
7:
8:
9:
NSDictionary *firstDict = [NSDictionary dictionaryWithObjectsAndKeys:@"image", @"Type", @"http://mysite.com/image.jpg", @"src", @"http://mysite.com/page.html", @"href", nil];
    	NSDictionary *secondDict = [NSDictionary dictionaryWithObjectsAndKeys:@"image", @"Type", @"http://mysite.com/image.jpg", @"src", @"http://mysite.com/page.html", @"href", nil];
    	NSArray *mediaArray = [[NSArray alloc] initWithObjects:firstDict, secondDict, nil];
    	
    	NSArray *keys = [NSArray arrayWithObjects:@"name", @"description", @"href", @"media", nil];
    	NSArray *objects = [NSArray arrayWithObjects:[NSString stringWithString:@"MyTitle"], [NSString stringWithString:@"My caption"],[NSString stringWithString:@"http://mysite.com/page.html"], mediaArray, nil];
    	
    	NSDictionary *attachment = [NSDictionary dictionaryWithObjects:objects forKeys:keys];
    	[[FBRequest requestWithDelegate:self] call:@"facebook.stream.publish" params:attachment];
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625