Objective-C
Objective-C
Transition from Imap.FetchSequence to Imap.FetchRange
Provides instructions for replacing deprecated FetchSequence method calls with FetchRange.Chilkat Objective-C Downloads
#import <CkoImap.h>
#import <CkoEmailBundle.h>
BOOL success = NO;
CkoImap *imap = [[CkoImap alloc] init];
// ...
// ...
int startSeqNum = 1;
int count = 5;
// ------------------------------------------------------------------------
// The FetchSequence method is deprecated:
CkoEmailBundle *bundleObj = [imap FetchSequence: [NSNumber numberWithInt: startSeqNum] numMessages: [NSNumber numberWithInt: count]];
if (imap.LastMethodSuccess == NO) {
NSLog(@"%@",imap.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using FetchRange.
// Your application creates a new, empty EmailBundle object which is passed
// in the last argument and filled upon success.
BOOL headersOnly = NO;
CkoEmailBundle *bundleOut = [[CkoEmailBundle alloc] init];
success = [imap FetchRange: headersOnly seqnum: [NSNumber numberWithInt: startSeqNum] count: [NSNumber numberWithInt: count] bundle: bundleOut];
if (success == NO) {
NSLog(@"%@",imap.LastErrorText);
return;
}