Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8800077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:29:30+00:00 2026-06-14T00:29:30+00:00

I’ve created a Mail.app plugin with Python to set a custom signature pulled from

  • 0

I’ve created a Mail.app plugin with Python to set a custom signature pulled from a remote server by swizzling the setSignature: method in ComposeBackEnd. As per the class dump below, I can set a plain text signature by using setSignatureContents: and this is functional.

@interface Signature : NSObject <NSCopying>
{
    NSString *_uniqueId;
    NSString *_name;
    NSData *_webArchiveData;
    BOOL _isRich;
    BOOL _isSavedAsRich;
    BOOL _isDirty;
    MFSyncedFile *_syncedFile;
}

- (id)syncedFile;
- (id)signaturePath;
- (unsigned long long)hash;
- (BOOL)isEqual:(id)arg1;
- (BOOL)isRich;
- (void)setIsRich:(BOOL)arg1;
- (void)setWebArchive:(id)arg1;
- (id)webArchive;
- (id)webArchiveData;
.....
- (void)setSignatureContents:(id)arg1;
- (id)signatureContents;
- (void)setSignatureName:(id)arg1;
- (id)signatureName;

@end

However when I attempt to set an HTML signature using setWebArchive: (which should take an NSData object):

signature.setWebArchive_(NSData.dataWithContentsOfURL_(NSURL.URLWithString_('http://...')))

I get the following error:

11/7/12 11:07:38.858 AM Mail[8820]: -[NSConcreteData data]: unrecognized selector sent to instance 0x7ffc2386bc00

(The remote file is already in the correct format)

Is there any way to make this work? Thanks in advance.


EDIT – tried this (returns WebArchive object which should respond to -[data]):

wds = WebDataSource.alloc().initWithRequest_(NSURLRequest.requestWithURL_(NSURL.URLWithString_('http://...')))
        webarchive = wds.webArchive
        signature.setWebArchive_(webarchive)

result:

11/7/12 3:26:59.173 PM Mail[16814]: An uncaught exception was raised
11/7/12 3:26:59.173 PM Mail[16814]: Class OC_PythonObject: no such selector: data
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:29:31+00:00Added an answer on June 14, 2026 at 12:29 am

    However when I attempt to set an HTML signature using setWebArchive: (which should take an NSData object)… I get the following error:

    11/7/12 11:07:38.858 AM Mail[8820]: -[NSConcreteData data]: unrecognized selector
    

    This error is telling you that -[setWebArchive:] is trying to call -[data] on your NSData object. Since -[NSData data] doesn’t exist, you get an unrecognized selector exception.

    Clearly it doesn’t take an NSData, it takes something that responds to -[data] by returning an NSData.

    EDIT – tried this (returns WebArchive object which should respond to -[data]):

    wds = WebDataSource.alloc().initWithRequest_(NSURLRequest.requestWithURL_(NSURL.URLWithString_('http://...')))
    webarchive = wds.webArchive
    signature.setWebArchive_(webarchive)
    

    Hold on… you haven’t shown the class dump for this one, but the other class has a method -[webArchive], not a properly webArchive. So, if they’re at all consistent, this one is also likely to have a method, not a property.

    If so, this means wds.webArchive is not going to be a a WebArchive object, it’s going to be a wrapper object that represents roughly the ObjC equivalent of a Python bound method. And calling -[data] on that thing will almost certainly fail.

    11/7/12 3:26:59.173 PM Mail[16814]: Class OC_PythonObject: no such selector: data
    

    If you just change that to wds.webArchive(), that should fix the problem.

    Finally, it’s worth doing a bit of debugging prints here. If you think you’ve got a WebArchive and -[WebArchive data] returns an NSData, you can test that really easily:

    print webArchive
    print webArchive.data()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.