MECL Paypal convert to ARC (IOS)

I am currently trying to integrate Paypal's MECL in an already existing IOS project using ARC.

I believe that by manually removing all the release / retain in the code should make it ARC compatible.

There is only one statement I do not know how to convert: "InitAndDealloc" that can be find in several class such as here:

static NSString *SolutionTypeStrings[] = {@"Sole", @"Mark"};
static NSString *LandingPageTypeStrings[] = {@"LandingPage", @"Billing", @"Login"};
static NSString *ChannelTypeStrings[] = {@"Merchant", @"eBayItem"};

#define LOCALE_CODE @"LocaleCode"

@implementation SetExpressCheckoutRequestDetails

InitAndDealloc

StringAccessor(ReturnURL)
StringAccessor(CancelURL)
StringAccessor1(cppHeaderImage, @"cpp-header-image")
StringAccessor1(cppHeaderBorderColor, @"cpp-header-border-color")
StringAccessor1(cppHeaderBackColor, @"cpp-header-back-color")
StringAccessor1(cppPayflowColor, @"cpp-payflow-color")
IntAccessor(AllowNote)
IntAccessor(ReqConfirmShipping)
TypedefAccessor(NoShipping, NoShippingType)
StringAccessor(Token)
AmountAccessor(MaxAmount)
StringAccessor(CallbackURL)
IntAccessor(CallbackTimeout)
GenericAccessor1(FlatRateShippingOptions, ShippingOptions)
IntAccessor(AddressOverride)
StringAccessor(PageStyle)
StringAccessor(BuyerEmail)
StringAccessor(giropaySuccessURL)
StringAccessor(giropayCancelURL)
StringAccessor(BanktxnPendingURL)
GenericAccessor(EnhancedCheckoutData)
GenericAccessor(BuyerDetails)
StringAccessor(BrandName)
GenericAccessor(FundingSourceDetails)
StringAccessor(CustomerServiceNumber)
IntAccessor(GiftMessageEnable)
IntAccessor(GiftReceiptEnable)
IntAccessor(GiftWrapEnable)
StringAccessor(GiftWrapName)
AmountAccessor(GiftWrapAmount)
IntAccessor(BuyerEmailOptinEnable)
StringAccessor(SurveyQuestion)
StringAccessor(CallbackVersion)
IntAccessor(SurveyEnable)
MutableArrayAccessor(PaymentDetails)
MutableArrayAccessor(BillingAgreementDetails)
MutableArrayAccessor1(OtherPaymentMethods, OtherPaymentMethodDetails)
MutableArrayAccessor1(SurveyChoice, NSString)
EnumAccessor(SolutionType, SolutionType)
EnumAccessor(LandingPage, LandingPageType);
EnumAccessor(ChannelType, ChannelType);

If I remove the line "InitAndDealloc", it seems as if I cannot set the variables anymore in the class. Indeed, I have also the working (Non ARC) paypal demo.

By doing this:

SetExpressCheckoutRequestDetails *sreq = [[SetExpressCheckoutRequestDetails alloc] init];
sreq.ReturnURL = @"Bob";
NSLog(@"%@  ", sreq.ReturnURL );

In both projects. Mine will return null, paypal's will return the Bob.

Has it even got anything to do with "InitAndDealloc" or am I looking at it wrong? If it is how do I replace "InitAndDealloc" in an ARC project? I can't seem to find a simple "Init" with autocompletion and by googling "InitAndDealloc" I get absolutely no results whatsoever :/

Thanks for reading!

Answers


I've never used MECL before but the way it's being called "InitAndDealloc" certainly is not Objective C and therefore wouldn't be subject to the same rules that ARC requires for Objective C. Best to leave it in place and not try to futz or struggle with it.

But anyways, instead of struggling with trying to ARC-enable some published & potentially-problematic SDK code, why not turn ARC off for the MECL files?

Here is a related question that describes how to turn ARC off for individual files.


Need Your Help

Why don't FastInject tags work in my Flex/Air Parsley project when build in release mode?

actionscript-3 flex intellij-idea air parsley

I've got a project that I am working on that works fine when debugging from IntelliJ but when I do a release build (still in IntelliJ) and install the .air fil to my computer none of the FastInject...

Prolog: Symmetric Rules

prolog logic-programming

I'm following a Prolog tutorial that asks to define a symmetric relation.