2013-04-15 161 views

回答

1

NSString * urlString = [NSString stringWithFormat:@「https://graph.facebook.com/YOUR_FRIEND_FB_ID/photos?access_token=%@」,self.accessToken];

UIImage * pic = [UIImage imageNamed:@"green-background.png"]; 
NSData *picData = UIImageJPEGRepresentation(pic, 1); 
NSURL *url = [NSURL URLWithString:urlString]; 
ASIFormDataRequest *newRequest = [ASIFormDataRequest requestWithURL:url]; 
[newRequest setPostValue:@"This is Sample Text" forKey:@"message"]; 
[newRequest setData:picData forKey:@"data"]; 
[newRequest setPostValue:self.accessToken forKey:@"access_token"]; 
[newRequest setDelegate:self]; 
[newRequest setDidFinishSelector:@selector(postToWallFinished:)]; 
[newRequest startAsynchronous]; 
相關問題