Objective-C
Objective-C
Transition from MailMan.FetchSingleHeaderByUidl to MailMan.FetchByUidl
Provides instructions for replacing deprecated FetchSingleHeaderByUidl 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];
// ...
// ...
int numBodyLines = 5;
NSString *uidl = @"123";
// ------------------------------------------------------------------------
// The FetchSingleHeaderByUidl method is deprecated:
CkoEmail *emailObj = [mailman FetchSingleHeaderByUidl: [NSNumber numberWithInt: numBodyLines] uidl: 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 = YES;
CkoEmail *emailOut = [[CkoEmail alloc] init];
success = [mailman FetchByUidl: uidl headerOnly: headerOnly numBodyLines: [NSNumber numberWithInt: numBodyLines] email: emailOut];
if (success == NO) {
NSLog(@"%@",mailman.LastErrorText);
return;
}