Objective-C
Objective-C
Transition from Email.CreateDsn to Email.ToDsn
Provides instructions for replacing deprecated CreateDsn method calls with ToDsn.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 CreateDsn method is deprecated:
CkoEmail *emailObj = [email CreateDsn: explanation xmlDeliveryStatus: statusFieldsXml bHeaderOnly: headerOnly];
if (email.LastMethodSuccess == NO) {
NSLog(@"%@",email.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using ToDsn.
// Your application creates a new, empty Email object which is passed
// in the last argument and filled upon success.
CkoEmail *dsnEmail = [[CkoEmail alloc] init];
success = [email ToDsn: explanation statusFields: statusFieldsXml headerOnly: headerOnly dsnEmail: dsnEmail];
if (success == NO) {
NSLog(@"%@",email.LastErrorText);
return;
}