Objective-C
Objective-C
Transition from Imap.FetchSingleHeader to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingleHeader method calls with FetchEmail.Chilkat Objective-C Downloads
#import <CkoImap.h>
#import <CkoEmail.h>
BOOL success = NO;
CkoImap *imap = [[CkoImap alloc] init];
// ...
// ...
// ------------------------------------------------------------------------
// The FetchSingleHeader method is deprecated:
CkoEmail *emailObj = [imap FetchSingleHeader: 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 = YES;
CkoEmail *emailOut = [[CkoEmail alloc] init];
success = [imap FetchEmail: headerOnly msgId: 1 bUid: NO email: emailOut];
if (success == NO) {
NSLog(@"%@",imap.LastErrorText);
return;
}