Ошибки и предупреждения ImageKit при компиляции с ARC - PullRequest
3 голосов
/ 16 ноября 2011

Я пытаюсь преобразовать свой проект в 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.

Но я могу, по крайней мере, собрать и запустить свою программу, если нацеливаться на 10,7 с помощью ARC.

Что здесь происходит? Это нормально? Или ImageKit просто не совместим с ARC?

1 Ответ

5 голосов
/ 16 ноября 2011

Оказывается, что Xcode 4.2 был бредом, потому что я импортировал напрямую, и в моем коде была привязана только платформа ImageKit. Это было хорошо для не-ARC кода, но ARC это не понравилось.

Переключение на импорт (который также включает ImageKit) и связывание всей платформы Quartz решило проблему. [ОБНОВЛЕНИЕ: Похоже, вам не нужно связывать всю платформу Quartz. Измените импорт на и продолжайте просто связывать ImageKit напрямую.]

Это странно.

...