CompileSwift states that "the current deployment target does not support __weak automatic links" for iOS8.0

I am trying to use a static library (compiled from Objective-C) from a Swift application.

I have one Objective-C bridge header that includes related headers. When creating the application, I get this error.

/someDirectory/Xcode/FirstSteps/headers/Acme.h:89: the current deployment target does not support automated __weak references

The Acme class uses weak references, but the goal of the deployment is iOS 8.0, which should support them. Am I barking the wrong tree?

line 89 Acme.h reads:

-(void) addTopicListener:(__weak NSObject<ACMETopicListenerDelegate>*) delegate;
+4
source share
1 answer

It turns out that the answer is to remove the attributes __weakfrom the method argument, or in my case include this in my bridge header

#undef __weak
#define __weak /* nothing */
#import "Acme.h"

SwiftCompile, -, __weak, . __weak .

+1

Source: https://habr.com/ru/post/1543602/


All Articles