Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code> -(IBAction)postMeFeedButtonPressed:(id)sender { postFeedCustom *detailViewController = [[postFeedCustom alloc] initWithNibName:@"postFeedCustom" bundle:nil]; [self.navigationController pushViewController:detailViewController animated:YES]; [detailViewController release]; </code></pre> <p>}</p> <pre><code>-(void)postMeFeedCustomized{ NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:4]; [variables setObject:postString forKey:@"message"]; //[variables setObject:@"http://bit.ly/bFTnqd" forKey:@"link"]; //[variables setObject:@"This is the bolded copy next to the image" forKey:@"name"]; //[variables setObject:@"This is the plain text copy next to the image. All work and no play makes Jack a dull boy." forKey:@"description"]; FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:@"me/feed" withPostVars:variables]; NSLog(@"postMeFeedButtonPressed: %@", fb_graph_response.htmlResponse); //parse our json SBJSON *parser = [[SBJSON alloc] init]; NSDictionary *facebook_response = [parser objectWithString:fb_graph_response.htmlResponse error:nil]; [parser release]; //let's save the 'id' Facebook gives us so we can delete it if the user presses the 'delete /me/feed button' self.feedPostId = (NSString *)[facebook_response objectForKey:@"id"]; NSLog(@"feedPostId, %@", feedPostId); NSLog(@"Now log into Facebook and look at your profile..."); </code></pre> <p>}</p> <p>in another class where you want user to post his custom message... you can do like this..</p> <pre><code> -(void) viewDidLoad{ [super viewDidLoad]; appDelegate=(oAuth2TestAppDelegate*)[[UIApplication sharedApplication]delegate]; </code></pre> <p>}</p> <pre><code> -(IBAction)FeedPost:(id)sender{ postString=postField.text; [appDelegate.viewController postMeFeedCustomized]; postField.text=@""; [postField resignFirstResponder]; } </code></pre> <p>have you seen that?? in this method for the button I have called the <code>postfeedcustomized</code> method and I am storing the textfield parameter in the <code>postString</code> and this is that postStirng that I am posting in <code>postfeedcustomized</code> method. see this instruction <code>[variables setObject:postString forKey:@"message"];</code></p> <p>here post string is the string ...which is in viewController 2 ...it carries the message entered by the user..now This is the code for posting message from another view...when button is pressed for posting feed it will go to another view controller where is a textbox..there user enters his message...and after he enters message the method <code>postfeedcustomized</code> is being called from that viewController..I have done this for the status only...chage it according to u r need and post pic from another View..</p>
 

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