zoukankan      html  css  js  c++  java
  • Obj-C, library with ARC code and warning

    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.

    这个有时候第三方库做的是arc的模式,如果工程中没有设置支持arc那么就会报警内存泄漏库中相应代码。这时候可以单独选择这些文件然后转换成arc格式的就可以了。

  • 相关阅读:
    iOS崩溃报告获取一
    GCDTimer
    Runtime
    Socket
    冒泡排序笔记
    学习java虚拟机笔记
    ftp发送文件包括中文名
    java email
    批量数据插入高效 转发
    读取本地硬盘文件,快速扫描插入 数据库
  • 原文地址:https://www.cnblogs.com/lisa090818/p/3491884.html
Copyright © 2011-2022 走看看