我是sharekit的新手。我正在尝试向 Facebook 发布一个简单的文本:@“Hello”,但这样做会遇到问题。它会引导我进入登录页面。我登录,然后它关闭并返回主屏幕。但是当我检查我的时间线时,它没有被添加..
我的 ViewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController{
UIButton *btn;
IBOutlet UIToolbar *toolbar;
}
@property (nonatomic,strong) UIButton *btn;
- (IBAction)btnShareClicked:(id)sender;
@end
我的 ViewController.m
#import "ViewController.h"
#import "SHK.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize btn;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
{
self.toolbarItems = [NSArray arrayWithObjects:
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(btnShareClicked:)] ,
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],
nil
];
}
return self;
}
- (IBAction)btnShareClicked:(id)sender {
NSString *text = @"Hello";
SHKItem *item = [SHKItem text:text];
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
// For Toolbar
//[actionSheet showFromToolbar:toolbar];
[actionSheet showInView:self.view];
}
@end
我已经包含了 MessageUI、Security、SystemConfiguration 框架......需要一些指导......