title: iPhone: Unrecognized selector sent to instance exception while publishing stream on Facebook
body: <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>