2013-02-21 92 views
0

最近我有它的工作,但現在它只是停了下來。按下按鈕時不做任何操作。代碼甚至不會給出斷點或錯誤。哪裏不對?Facebook和Twitter分享按鈕停止工作

Download Project (3.2mb)

- (IBAction)ShareFB 
{ 
    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) 
    { 
     slComposeViewController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; 
     [slComposeViewController addImage:[UIImage imageNamed:@"logo-carrito.png"]]; 
     [slComposeViewController addURL:[NSURL URLWithString:@"http://www.google.com"]]; 
     [self presentViewController:slComposeViewController animated:YES completion:NULL]; 
    } 
    else { 
     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No FB Account" message:@"There are no FB account registered. Configure one" delegate:nil cancelButtonTitle:@"Dissmiss" otherButtonTitles:nil]; 
     [alert show]; 
    } 
} 

- (IBAction)ShareTW 
{ 
    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) 
    { 
     slComposeViewController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; 
     [slComposeViewController addImage:[UIImage imageNamed:@"logo-carito.png"]]; 
     [slComposeViewController addURL:[NSURL URLWithString:@"http://www.google.com"]]; 
     [self presentViewController:slComposeViewController animated:YES completion:NULL]; 
    } 
    else { 
     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No TW Account" message:@"There are no TW accounts registered. Configure one." delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; 
     [alert show]; 
    } 
} 
+1

所以你希望我們爲你調試你的代碼? – zerkms 2013-02-21 20:39:21

回答

1

在你的故事板,你的第一個場景都有其類設置爲ViewController,但在實際上卻顯然應列入你的項目,例如中的一個類Tab1_ViewController

+0

這工作。謝謝!你會願意與我進行語音聊天嗎?dix /做一些其他的東西? – AlexPjz 2013-02-22 02:29:46

+0

@AlexPjz隨時對S.O.發佈其他問題。如果你沒有得到足夠的答案(和/或我沒有看到發佈的問題),請在這裏添加評論,我會努力去看看它。 – Rob 2013-02-23 05:30:30