Note that there are some explanatory texts on larger screens.

plurals
  1. POiPhone: Unrecognized selector sent to instance exception while publishing stream on Facebook
    primarykey
    data
    text
    <p>I have wrote following code to logged into Facebook account followed by posting comment on user's facebook wall. It's working fine and posting everything mentioned below on Facebook wall but it throwing following exception and termination application abnormally. I scratched my head a lot but couldn't find anything wrong. Could anyone please tell me what's wrong in my code? FYI I have combined this code from <a href="https://stackoverflow.com/questions/1652049/fbconnect-facebook-stream-publish-with-nsdictionary-problems">link1</a> and <a href="https://stackoverflow.com/questions/2744078/iphone-fbconnect-auto-post-to-user-wall">link2</a>Thanks!</p> <p>Exception:</p> <pre><code>-[NSConcreteMutableData objectForKey:]: unrecognized selector sent to instance 0x34a560 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteMutableData objectForKey:]: unrecognized selector sent to instance 0x34a560' </code></pre> <p>Login into Facebook code:</p> <pre><code>- (void)login { NSLog(@"Logging into Facebook..."); UniversalAppAppDelegate *delegate = (UniversalAppAppDelegate *) [[UIApplication sharedApplication] delegate]; NSArray* requiredPermissions = [NSArray arrayWithObjects:@"read_stream", @"publish_stream", @"offline_access",nil]; if (![[delegate facebook] isSessionValid]) { [delegate facebook].sessionDelegate = self; [[delegate facebook] authorize:requiredPermissions]; } } </code></pre> <p>Posting on wall:</p> <pre><code>- (void)postCommentToFacebookWall:(NSString*)comment { UniversalAppAppDelegate *delegate = (UniversalAppAppDelegate *) [[UIApplication sharedApplication] delegate]; NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: kAppId, @"api_key", @"This is test message from my iPhone App",@"message", nil]; [[delegate facebook] requestWithMethodName:@"stream.publish" andParams:params andHttpMethod:@"POST" andDelegate:self]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload