Facebook和Twitter分享button停止工作
最近我有这个工作,但现在只是停了下来。 按下button时不做任何操作。 这个代码甚至不会给出断点或错误。 哪里不对?
下载项目(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]; } }
在你的故事板中,你的第一个场景的类被设置为ViewController
,但实际上它应该是你的项目中包含的类之一,例如Tab1_ViewController
。
- 如何在共享菜单中列出?
- 如何通过iOS应用程序中的其他应用程序共享内容/数据,就像我们在Intent.ACTION_SEND的Android应用程序中所做的一样?
- 通过WebRTCstream式传输屏幕截图,作为来自iOS的videostream
- 使用AirDrop分享资产库中的video失败
- 共享一个mkmapview截图
- WhatsApp共享不工作(相同的代码正在另一个项目中工作)
- UIActivityViewController与iOS中的UIDocumentInteractionController
- 如果在后台运行一个动作,如何显示蓝色状态栏
- Hackhactons中的iOS开发与未知的开发者? 如何共享Xcode和debugging工具给没有OSX设备的人?