(Objective-C) Transition from MailMan.LoadXmlEmailString to Email.SetFromXmlText
Provides instructions for replacing deprecated LoadXmlEmailString method calls with Email.SetFromXmlText. Note: This example requires Chilkat v11.0.0 or greater.
#import <CkoMailMan.h>
#import <NSString.h>
#import <CkoEmail.h>
CkoMailMan *mailman = [[CkoMailMan alloc] init];
// ...
// ...
NSString *xmlStr = @"...";
// ------------------------------------------------------------------------
// The LoadXmlEmailString method is deprecated:
CkoEmail *emailObj = [mailman LoadXmlEmailString: xmlStr];
if (mailman.LastMethodSuccess == NO) {
NSLog(@"%@",mailman.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using Email.SetFromXmlText.
CkoEmail *email = [[CkoEmail alloc] init];
BOOL success = [email SetFromXmlText: xmlStr];
if (success == NO) {
NSLog(@"%@",email.LastErrorText);
return;
}
|