Archived Forum Post

Index of archived forum posts

Question:

Unrecognized selector for FetchSingleHeaderAsMime

Oct 28 '15 at 14:55

Hi,

why do I get an unrecognized selector error when trying to do a call to FetchSingleHeaderAsMime but the similar call to FetchSingleAsMime works fine? Or I'm overlooking something simple as usual.

Works fine:

'get the body of a mail:

dim messageID as Integer = MessageSet.getID(counter - 1)

declare function getMail lib ImapLibLocation selector "FetchSingleAsMime:bUid:" (obj as Ptr, n as Ptr, fetchUuids as Boolean) as CFStringRef

dim n as Cocoa.NSNumber = NSNumber.CreateWithInteger(messageID)

dim theBody as String = getMail(self, n, True)

Doesn't work:

'get the header of a mail

dim messageID as Integer = MessageSet.getID(counter)

declare function getHeader lib ImapLibLocation selector "FetchSingleHeaderAsMime:bUid:" (obj as Ptr, n as Ptr, fetchUuids as Boolean) as CFStringRef

dim n as Cocoa.NSNumber = NSNumber.CreateWithInteger(messageID)

dim theHeader as String = getHeader(self, n, True)

MessageSet is the result of a declare to

declare Function searchAll lib ImapLibLocation selector "Search:bUid:" (obj as Ptr, refname as CFStringRef, fetchUuids as Boolean) as Ptr

Latest Chilcat Objective-C dylib. Xojo 2015r3. Mac OS 10.10.5.


Answer

By the way, the following code works fine:

Declare Function getHeader lib ImapLibLocation selector "FetchSingleHeader:bUid:" (obj as Ptr, n as Ptr, fetchUuids as Boolean) as Ptr

dim n as Cocoa.NSNumber = NSNumber.CreateWithInteger(messageID)

dim HeaderPointer as Ptr = getHeader(self, n, True)


Answer

Thanks! By the way, Chilkat is working on a Xojo API where the Chilkat classes will be conveniently available as Xojo classes. The work is underway. Essentially, Chilkat will provide the Xojo classes with all the properties and methods backed by the "Declare" statements..

The Xojo work is underway, but some higher priority development tasks have superseded it for now, so the ETA is at least 1 month away, but shouldn't be more than 2 months away..