GData static library: exclude files from ARC with -fno-objc-arc?

十年热恋 提交于 2019-12-01 11:53:05

Well I asked and found the unswear 10 minutes later. Any way if it will help someone:

  1. The problem is only with the .h files, Goole remark is only for cases you embed the library not as static library.
  2. After someone reported the problem to google, they added new macros that solve the problem, this is how:

search the header files for file named : GDataDefines.h and add this code inside:

//
// Simple macros to allow building headers for non-ARC files
// into ARC apps
//

#ifndef GDATA_REQUIRES_ARC
#if defined(__clang__)
#if __has_feature(objc_arc)
#define GDATA_REQUIRES_ARC 1
#endif
#endif
#endif

#if GDATA_REQUIRES_ARC
#define GDATA_UNSAFE_UNRETAINED __unsafe_unretained
#else
#define GDATA_UNSAFE_UNRETAINED
#endif

Then in the GDataObject.h which causes the ARC errors

Change the GDataDescriptionRecord struct to

   typedef struct GDataDescriptionRecord {
       NSString GDATA_UNSAFE_UNRETAINED *label;
       NSString GDATA_UNSAFE_UNRETAINED  *keyPath;
       GDataDescRecTypes reportType;
   } GDataDescriptionRecord;

And the

   __weak GDataObject *parent_;  // parent in tree of GData objects

to

   GDataObject GDATA_UNSAFE_UNRETAINED *parent_;

This is the link to google update: http://code.google.com/p/gdata-objectivec-client/source/detail?r=712

That's it.

Hope it will help someone

Shani

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!