简体   繁体   中英

Obj-C, library with ARC code and warning - Method possibly missing a [super dealloc] call?

I'm adding the MKStoreKit to my app and I'm getting a warning, Method possibly missing a [super dealloc] call . I know the library has been converted for the new ARC.

However, I'm not ready to convert my whole app to ARC.

How should I proceed?

Is it safe to use the ignore option, or do I need to add a setting for my app somewhere ?

Click on the Xcode project in the file navigator on the left of the Xcode window. Now select your app target, and look for the "Build Phases" tab in the main view. Under there, you'll see the "Compile Sources" phase. For each of the files in MKStoreKit, edit the compiler flags in Compile Sources to add:

-fobjc-arc

That lets you compile these files correctly with ARC, but carry on using manual reference counting through your own code.

You have to download old version of MKStoreKit because every object need to have metod - (void)dealloc and inside this [super dealloc]. You can also refactor your project to ARC using Refactor->Convert to ARC or you can enable ARC for some header file using flag : -fobjc-arc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM