(Objective-C) Transition from Imap.FetchSingle to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail. Note: This example requires Chilkat v11.0.0 or greater.
#import <CkoImap.h>
#import <CkoEmail.h>
CkoImap *imap = [[CkoImap alloc] init];
// ...
// ...
// ------------------------------------------------------------------------
// The FetchSingle method is deprecated:
CkoEmail *emailObj = [imap FetchSingle: 1 bUid: NO];
if (imap.LastMethodSuccess == NO) {
NSLog(@"%@",imap.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using FetchEmail.
// Your application creates a new, empty Email object which is passed
// in the last argument and filled upon success.
BOOL headerOnly = NO;
CkoEmail *email = [[CkoEmail alloc] init];
BOOL success = [imap FetchEmail: headerOnly msgId: 1 bUid: NO email: email];
if (success == NO) {
NSLog(@"%@",imap.LastErrorText);
return;
}
|