0
我新手sharekit。我試圖發佈一個簡單的文本:@「你好」Facebook,但面臨問題這樣做..它使我到登錄頁面。我登錄後關閉並返回主屏幕。但是,當我檢查我的時間表,所以不加..發佈至Facebook從Sharekit
我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,安全,SystemConfiguration框架。 ..需要一些指導這個..
首先,當我開始,我下載了你給這些正在基於最新sharekit codes..next我加你的代碼,它給我這個錯誤的網站sharekit:爲SHKFacebook無可見接口聲明選擇器setSHKItem。 – laksh
@laksh你在ShareKit API中是否有這些類,如果是OS,那麼你應該使用我的代碼而不是你的。 – Kamarshad
我讓他們下Sharekit-> Sharers->服務 - > Facebook的 – laksh