Objective-C
Objective-C
Transition from Email.CreateMdn to Email.ToMdn
Provides instructions for replacing deprecated CreateMdn method calls with ToMdn.Chilkat Objective-C Downloads
#import <CkoEmail.h>
#import <NSString.h>
BOOL success = NO;
CkoEmail *email = [[CkoEmail alloc] init];
// ...
// ...
NSString *explanation = @"...";
NSString *statusFieldsXml = @"...";
BOOL headerOnly = NO;
// ------------------------------------------------------------------------
// The CreateMdn method is deprecated:
CkoEmail *emailObj = [email CreateMdn: explanation xmlMdnFields: statusFieldsXml bHeaderOnly: headerOnly];
if (email.LastMethodSuccess == NO) {
NSLog(@"%@",email.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using ToMdn.
// Your application creates a new, empty Email object which is passed
// in the last argument and filled upon success.
CkoEmail *emailOut = [[CkoEmail alloc] init];
success = [email ToMdn: explanation statusFields: statusFieldsXml headerOnly: headerOnly mdn: emailOut];
if (success == NO) {
NSLog(@"%@",email.LastErrorText);
return;
}