在我的应用程序中,我已经自定义了sharekit,通过按下我自己的按钮将图像发送到twitter / facebook。为此,我需要创建一个SHKShaerer实例并将其Delegate设置为我的类:
self.theSharer = [SHKFacebook shareItem:item];
self.theSharer.shareDelegate = self;
为了使其正常工作,我还需要导入Sharer-Class
#import "SHKSharer.h"
实施'SHKSharerDelegate'-Protokoll,将SHKSharer-instancevariable添加到界面,将其设置为
@property (nonatomic,retain) SHKSharer* theSharer;
并在.m文件中合成它。
然后我添加了protokoll-methods
- (void)sharerStartedSending:(SHKSharer *)sharer{}
- (void)sharerFinishedSending:(SHKSharer *)sharer{}
- (void)sharer:(SHKSharer *)sharer failedWithError:(NSError *)error shouldRelogin:(BOOL)shouldRelogin{}
- (void)sharerCancelledSending:(SHKSharer *)sharer{}
并开始使用它们。
unfort。从那以后,SHKActivityIndicator-Messages告诉用户发生了什么,也没有看到错误消息。
为什么会发生这种情况,我怎么能让他们回来? 日Thnx!
答案 0 :(得分:0)
我发现在SHKSharer.m被告知
// These are used if you do not provide your own custom UI and delegate
- (void)sharerStartedSending:(SHKSharer *)sharer
{
if (!quiet)
[[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Saving to %@", [[self class] sharerTitle])];
}
...
所以我需要在我自己的Protokol-Methodas中调用它们!