我試過使用下面的代碼,但它一直讓用戶顯示網站,我需要它將它們帶到iPhone,iPad和iPod上的應用程序!如何製作一個操作按鈕,讓用戶訪問iOS應用程序中的Facebook應用程序?
- (IBAction)fbIconGo:(id)sender {
NSURL *fbURL = [[NSURL alloc] initWithString:@"https:facebook.com/numberHERE"];
// check if app is installed
if (! [[UIApplication sharedApplication] canOpenURL:fbURL]) {
// if we get here, we can't open the FB app.
fbURL = [[NSURL alloc] initWithString:@"https:facebook.com/NUMBER HERE"];; // direct URL on FB website to open in safari
}
[[UIApplication sharedApplication] openURL:fbURL];
[從其他應用中打開Facebook應用](http://stackoverflow.com/questions/4725815/open-facebook-app-from-other-app) – n00bProgrammer