Sample code for 30+ languages & platforms
Objective-C

Transition from Imap.FetchBundleAsMime to Imap.FetchSingleBd

Provides instructions for replacing deprecated FetchBundleAsMime method calls with FetchSingleBd.

Chilkat Objective-C Downloads

Objective-C
#import <CkoImap.h>
#import <CkoMessageSet.h>
#import <CkoStringArray.h>
#import <CkoBinData.h>

BOOL success = NO;

CkoImap *imap = [[CkoImap alloc] init];

//  ...
//  ...

CkoMessageSet *mset = [[CkoMessageSet alloc] init];
success = [imap QueryMbx: @"FROM joe@example.com" bUid: YES msgSet: mset];
//  ...
//  ...

//  ------------------------------------------------------------------------
//  The FetchBundleAsMime method is deprecated:

CkoStringArray *saObj = [imap FetchBundleAsMime: mset];
if (imap.LastMethodSuccess == NO) {
    NSLog(@"%@",imap.LastErrorText);
    return;
}

//  ...
//  ...

//  ------------------------------------------------------------------------
//  Do the equivalent using FetchSingleBd.

imap.AutoDownloadAttachments = YES;

CkoBinData *bdMime = [[CkoBinData alloc] init];
BOOL bUid = mset.HasUids;
int numEmails = [mset.Count intValue];
int i = 0;
while (i < numEmails) {
    success = [imap FetchSingleBd: [mset GetId: [NSNumber numberWithInt: i]] bUid: bUid mimeData: bdMime];
    //  ...
    //  ...

    i = i + 1;
}