我試圖將我的項目轉換爲ARC,但我在我的項目中使用ImageKit。 ARC重構工具和我自己的手動重構都會在ImageKit頭文件中使用ARC生成錯誤和警告,這些錯誤和警告已包含在我自己的源文件中。他們看起來像這樣:與ARC編譯時ImageKit錯誤和警告
In file included from /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/ImageKit.h:9:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFController.h:12:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFOperation.m:10:
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/IKImageBrowserView.h:176:14: error: the current deployment target does not support automated __weak references [4]
IBOutlet __weak NSScroller* _horizontalScroller;
^
<built-in>:115:31: note: instantiated from:
#define __weak __attribute__((objc_ownership(weak)))
^
In file included from /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/ImageKit.h:9:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFController.h:12:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFOperation.m:10:
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/IKImageBrowserView.h:177:14: error: the current deployment target does not support automated __weak references [4]
IBOutlet __weak id _delegate;
^
<built-in>:115:31: note: instantiated from:
#define __weak __attribute__((objc_ownership(weak)))
^
In file included from /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/ImageKit.h:9:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFController.h:12:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFOperation.m:10:
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/IKImageBrowserView.h:179:11: warning: '__strong' only applies to objective-c object or block pointer types; type here is 'void *' [3]
void* __strong _reserved;
^
In file included from /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/ImageKit.h:10:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFController.h:12:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFOperation.m:10:
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/IKImageBrowserCell.h:36:2: error: the current deployment target does not support automated __weak references [4]
__weak id _parent;
^
<built-in>:115:31: note: instantiated from:
#define __weak __attribute__((objc_ownership(weak)))
^
這就是當我設置我的項目設置爲目標10.6。當目標10.7,我只是得到警告:
In file included from /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/ImageKit.h:9:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFController.h:12:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFGenerator.m:12:
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/IKImageBrowserView.h:179:11: warning: '__strong' only applies to objective-c object or block pointer types; type here is 'void *' [3]
void* __strong _reserved;
^
In file included from /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/ImageKit.h:10:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFController.h:12:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFGenerator.m:12:
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/IKImageBrowserCell.h:37:8: warning: '__strong' only applies to objective-c object or block pointer types; type here is 'void *' [3]
void* __strong _ibCellReserved;
^
In file included from /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/ImageKit.h:13:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFController.h:12:
In file included from /Volumes/Macintosh HD/Users/simone/Development/AFGenerator.m:12:
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Headers/IKPictureTaker.h:31:11: warning: '__strong' only applies to objective-c object or block pointer types; type here is 'void *' [3]
void *__strong _ikReserved;
^
3 warnings generated.
但我至少可以構建和定位只是ARC 10.7運行時,我的程序。
這是怎麼回事?這是正常的嗎?或者ImageKit與ARC不兼容?
<雷達:// 10465720> @private __weak在IKImageBrowserView.h導致錯誤建設10.6 ARC –
高德<雷達:// 13296941> __strong無效*與ARC –