最近我有它的工作,但现在它只是停了下来。按下按钮时不做任何操作。代码甚至不会给出断点或错误。哪里不对?Facebook和Twitter分享按钮停止工作
- (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];
}
}
所以你希望我们为你调试你的代码? – zerkms 2013-02-21 20:39:21