Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6351867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:05:28+00:00 2026-05-24T22:05:28+00:00

I am trying to post to Facebook from my iPhone app and it just

  • 0

I am trying to post to Facebook from my iPhone app and it just doesn’t work.

This is what I am doing:

if (![_facebook isSessionValid])
    {
        NSArray *permissions =  [NSArray arrayWithObjects:
                                 @"read_stream", @"publish_stream", @"offline_access",nil];

        [facebook authorize:permissions delegate:self];
    }

    NSMutableDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys:
                            @"User Prompt Message",  @"user_message_prompt",
                            @"http://www.mywebsite.com/", @"link",
                            @"http://mywebsite.com/wp-content/uploads/2011/05/iTunesArtwork.png", @"picture",
                            nil];


    [facebook requestWithGraphPath:@"me/feed"
                         andParams:params  
                     andHttpMethod:@"POST" 
                       andDelegate:self];

I also tried

[self.facebook dialog:@”feed” andParams:params andDelegate:self];

but in either case my app is getting terminated either in

  • (FBRequest*)openUrl:(NSString *)url
    params:(NSMutableDictionary *)params
    httpMethod:(NSString *)httpMethod
    delegate:(id)delegate

or in

  • (void)dialog:(NSString *)action
    andParams:(NSMutableDictionary *)params andDelegate:(id
    )delegate

depending on which method I call with this log:

* Terminating app due to uncaught exception
‘NSInternalInconsistencyException’, reason: ‘-[__NSCFDictionary
setObject:forKey:]: mutating method sent to immutable object’

It doesn’t make sense to me because the dictionaries being used are mutable.

Am I doing something wrong? Any help would be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:05:30+00:00Added an answer on May 24, 2026 at 10:05 pm

    It doesn’t make sense to me because the dictionaries being used are mutable.

    No, they are not. Despite that you are assigning the returned object to a NSMutableDictionary variable, you are creating a NSDictionary here:

    NSMutableDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys:
                                        ^
                                      Here!
                                  @"User Prompt Message",  @"user_message_prompt",
                                  @"http://www.mywebsite.com/", @"link",
                                  @"http://mywebsite.com/wp-content/uploads/2011/05/iTunesArtwork.png", @"picture",
                                  nil];
    

    This should be:

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:...];
    

    This is likely the cause of the crash:

    • Terminating app due to uncaught exception
      ‘NSInternalInconsistencyException’, reason: ‘-[__NSCFDictionary
      setObject:forKey:]: mutating method sent to immutable object‘

    because the Facebook API expects a mutable dictionary:

    - (FBRequest*)requestWithGraphPath:(NSString *)graphPath
                             andParams:(NSMutableDictionary *)params
                                                ^
                                     It needs to be mutable!
                         andHttpMethod:(NSString *)httpMethod
                           andDelegate:(id <FBRequestDelegate>)delegate;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to post directly from my iOS App to the Facebook application page
I am trying to post text from my iPhone app to my wall on
I'm trying to get an Android app to post highscores to Facebook, similar to
I am trying to integrate Facebook to my Android app for social post. I
Trying to post a screenshot in a tweet from within my app.. so far
I'm trying to get just a piece of information from Facebook, but I don't
i am trying to implement the facebook connect on my iphone App. after the
I'm using the Facebook iOS SDK to post videos from my app to the
I'm trying to post a link + status through my app, using this "popup"
In my iPhone app, I'm trying to allow users to post an audio track

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.