Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>However when I attempt to set an HTML signature using setWebArchive: (which should take an NSData object)… I get the following error:</p> </blockquote> <pre><code>11/7/12 11:07:38.858 AM Mail[8820]: -[NSConcreteData data]: unrecognized selector </code></pre> <p>This error is telling you that <code>-[setWebArchive:]</code> is trying to call <code>-[data]</code> on your <code>NSData</code> object. Since <code>-[NSData data]</code> doesn't exist, you get an unrecognized selector exception.</p> <p>Clearly it doesn't take an <code>NSData</code>, it takes something that responds to <code>-[data]</code> by returning an <code>NSData</code>.</p> <blockquote> <p>EDIT - tried this (returns WebArchive object which should respond to -[data]):</p> </blockquote> <pre><code>wds = WebDataSource.alloc().initWithRequest_(NSURLRequest.requestWithURL_(NSURL.URLWithString_('http://...'))) webarchive = wds.webArchive signature.setWebArchive_(webarchive) </code></pre> <p>Hold on… you haven't shown the class dump for this one, but the other class has a method <code>-[webArchive]</code>, not a properly <code>webArchive</code>. So, if they're at all consistent, this one is also likely to have a method, not a property.</p> <p>If so, this means <code>wds.webArchive</code> is not going to be a a <code>WebArchive</code> object, it's going to be a wrapper object that represents roughly the ObjC equivalent of a Python bound method. And calling <code>-[data]</code> on that thing will almost certainly fail.</p> <pre><code>11/7/12 3:26:59.173 PM Mail[16814]: Class OC_PythonObject: no such selector: data </code></pre> <p>If you just change that to <code>wds.webArchive()</code>, that should fix the problem.</p> <p>Finally, it's worth doing a bit of debugging prints here. If you think you've got a <code>WebArchive</code> and <code>-[WebArchive data]</code> returns an <code>NSData</code>, you can test that really easily:</p> <pre><code>print webArchive print webArchive.data() </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload