Objective-C
Objective-C
Transition from MailMan.FetchEmail to MailMan.FetchByUidl
Provides instructions for replacing deprecated FetchEmail method calls with FetchByUidl.Chilkat Objective-C Downloads
#import <CkoMailMan.h>
#import <NSString.h>
#import <CkoEmail.h>
BOOL success = NO;
CkoMailMan *mailman = [[CkoMailMan alloc] init];
// ...
// ...
NSString *uidl = @"123";
// ------------------------------------------------------------------------
// The FetchEmail method is deprecated:
CkoEmail *emailObj = [mailman FetchEmail: uidl];
if (mailman.LastMethodSuccess == NO) {
NSLog(@"%@",mailman.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using FetchByUidl.
// Your application creates a new, empty Email object which is passed
// in the last argument and filled upon success.
BOOL headerOnly = NO;
// Irrelevant because we are not downloading headers-only.
int numBodyLines = 0;
CkoEmail *emailOut = [[CkoEmail alloc] init];
success = [mailman FetchByUidl: uidl headerOnly: headerOnly numBodyLines: [NSNumber numberWithInt: numBodyLines] email: emailOut];
if (success == NO) {
NSLog(@"%@",mailman.LastErrorText);
return;
}