在我的應用程序中。我成功地在我的Facebook牆上張貼圖像(圖像類型JPEG類型)。它在Simulator和Device中也可以正常工作。圖片在Facebook上發佈?
但問題是,當我從我的iPhone拍攝圖像或從相機捕獲的庫中選擇一個圖像。它不是發佈在Facebook牆上。
另一方面,當我從我的iPhone庫選擇任何JPEG圖像(通過互聯網下載)。它張貼在牆上。
在我看來有圖像格式問題。請引導我
謝謝
我的代碼在這裏。
-(IBAction)clickButtonClicked
{
// For link post
NSString *Message = [NSString stringWithFormat:@"Testing Iphone App : \"http://www.google.com\" "];
DataClass *obj=[DataClass getInstance];
UIImage *image=[[UIImage alloc]init ];
image= obj.imgFinalImage;
NSMutableDictionary *params1 = [[NSMutableDictionary alloc]init];
[params1 setObject:image forKey:@"source"];
[params1 setObject:Message forKey:@"message"];
NSString *[email protected]"/me/photos";
[[appDelegate facebook] requestWithGraphPath:post andParams:params1 andHttpMethod:@"POST" andDelegate:self];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message!" message:@"Invitation Send Sucessfully" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];
}
一個問題,爲什麼你在這裏分配的'UIImage':'*的UIImage image = [[UIImage alloc] init];'當你在下一行時,你將'obj.imgFinalImage'分配給圖像。你只是在這裏泄漏圖像變量。 – rckoenes 2012-08-03 14:09:11
@rckoenes。你是對的。我很多時候改變我的代碼..所以我忘記了..謝謝 – QueueOverFlow 2012-08-03 14:12:46