cedarbdd / cedar

BDD-style testing using Objective-C
http://groups.google.com/group/cedar-discuss
1.19k stars 140 forks source link

Weak References in XCode 7.3 #385

Closed mkanthan closed 8 years ago

mkanthan commented 8 years ago

I've come across an issue after upgrading to XCode 7.3 - and I'm not sure if this is something that should be addressed by Cocoapods or Cedar. My Specs target compiled and ran fine in XCode 7.2.1.

My configuration:

The Specs target no longer compiles and gives me this error in CDRSpyInfo.mm: screen shot 2016-04-01 at 1 26 19 pm

Cannot create __weak reference in file using manual reference counting

Until I received this error, I wasn't even aware that ARC is turned OFF by Cocoapods, in the Pods project. My Specs target, and project build configurations clearly have it set to YES.

Looking at the above screenshot, I did some digging and found an Apple developer thread about the same issue: https://forums.developer.apple.com/thread/38934 and also a Stackoverflow post about the same: http://stackoverflow.com/questions/36147625/xcode-7-3-cannot-create-weak-reference-in-file-using-manual-reference-counting

The official word from Apple (contained in those threads) is that the semantics will change in the future and implies that references to __weak should be removed. I've experimented with Weak References in Manual Retain Release to YES in my Pods project, and this causes a different error in CDRSpyInfo.mm.

So, I'm not sure where to go from here. Is there any plan to remove those or is there a work-around of some sort?

briancroom commented 8 years ago

Hey @mkanthan! We have just released Cedar v0.13.1 which addresses this (and other) issues.

medmonds commented 8 years ago

@mkanthan If you also use PivotalCoreKit be sure to not init or deinit its copy of Cedar because it has not yet been updated and will cause the same issue. Oh never mind , you're using CocoaPods.

mkanthan commented 8 years ago

Great! I see this was released 2 hours ago, which was probably just after I checked for a recent update. I will upgrade.

mkanthan commented 8 years ago

Upgrading to 0.13.1 fixed it.