如何定義使用NSSharingService組成的郵件主題?使用NSSharingService定義郵件主題
我已經通過NSSharingService Class reference,但沒有看到它在任何地方定義。以下成功啓動郵件應用程序,但主題只是與文本一起推入郵件正文中。
NSAttributedString *text = [self.noteSynopsisView attributedString];
NSString *subject = @"My Subject";
NSArray *shareItems = [NSArray arrayWithObjects:text, subject, nil];
NSSharingServicePicker *sharingServicePicker = [[NSSharingServicePicker alloc] initWithItems:shareItems];
sharingServicePicker.delegate = self;
[sharingServicePicker showRelativeToRect:[self.shareButton bounds] ofView:self.shareButton preferredEdge:NSMaxYEdge];
在iOS中,你通常做類似下面以定義一個主題爲MailComposer
[sharingServicePicker setSubject:@"My Subject"];
但SharingServicePicker不支持SETSUBJECT。
如果([mailShare respondsToSelector:@selector(SETSUBJECT :)] [mailShare SETSUBJECT:@ 「主題」]; – Borzh