(Objective-C) Transition from MailMan.LoadMbx to MailMan.LoadMbxFile
Provides instructions for replacing deprecated LoadMbx method calls with LoadMbxFile. Note: This example requires Chilkat v11.0.0 or greater.
#import <CkoMailMan.h>
#import <NSString.h>
#import <CkoEmailBundle.h>
CkoMailMan *mailman = [[CkoMailMan alloc] init];
// ...
// ...
NSString *filePath = @"c:/test/example.mbx";
// ------------------------------------------------------------------------
// The LoadMbx method is deprecated:
CkoEmailBundle *bundleObj = [mailman LoadMbx: filePath];
if (mailman.LastMethodSuccess == NO) {
NSLog(@"%@",mailman.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using LoadMbxFile.
// Your application creates a new, empty EmailBundle object which is passed
// in the last argument and filled upon success.
CkoEmailBundle *bundleOut = [[CkoEmailBundle alloc] init];
BOOL success = [mailman LoadMbxFile: filePath bundle: bundleOut];
if (success == NO) {
NSLog(@"%@",mailman.LastErrorText);
return;
}
|