0

While I was trying to bind a pod to Xamarin, I ran into some errors.

I executed the following commands:

sharpie pod init ios libPusher
sharpie pod bind

But that gave me errors like this:

- (RACSignal *)rac_valuesAndChangesForKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options observer:(__weak ...
                                                                                                                        ^
While building module 'ReactiveCocoa' imported from /private/var/folders/96/fpnn11nx4gbdjxbmclkpdl3w0000gn/T/com.xamarin.ObjectiveSharpie/fec0ff8e35944ff0a2a574f1ff606d2f.h:1:
In file included from <module-includes>:1:
In file included from /Users/vrwim/Downloads/libPusher-master/binding/build/Release-iphoneos/ReactiveCocoa/ReactiveCocoa.framework/Headers/ReactiveCocoa-umbrella.h:42:
/Users/vrwim/Downloads/libPusher-master/binding/build/Release-iphoneos/ReactiveCocoa/ReactiveCocoa.framework/Headers/RACKVOChannel.h:85:23: error: 
      cannot create __weak reference in file using manual reference counting

I tried editing the Pods.xcodeproj and setting each project to use automatic reference counting, but this did not appear to work.

Do I need to add a clang option to enable automatic reference counting, or is something else going on?

vrwim
  • 13,020
  • 13
  • 63
  • 118

1 Answers1

0

Open the project on question in Xcode and within the Build Setting set:

Weak References in Manual Retain Release to Yes

enter image description here

SushiHangover
  • 73,120
  • 10
  • 106
  • 165
  • That is what I have done for each target and the project itself. This does not resolve the issue. I think I might need to send the option to sharpie, as it may build the xcodeproj itself, without looking at the build settings. – vrwim Oct 26 '16 at 09:20
  • @vrwim `-fobjc-weak` is the cmd line option. You can also mod the podfile: http://stackoverflow.com/a/36712877/4984832 – SushiHangover Oct 26 '16 at 09:31