Comments (6)
Thanks for opening this issue @codeman9 -- I hadn't been aware of this breakage in the betas.
I don't have an answer to this issue right now -- it looks like we'll need to either investigate moving this over to ARC (which may be very hard to get right), or find another way of creating a weak reference. It's a little frustrating that Apple seems to be implying that weak references never worked outside of ARC, because I'm fairly certain I've actually seen __weak
resolve retain cycles when ARC wasn't being used. Maybe I'm wrong.
from cedar.
My understanding of these statements is that the __weak
attribute never actually did anything in MRC, which isn't surprising to me at all. In MRC all references are effectively weak anyway, it just means that the auto-zeroing behavior wasn't available unless you called down to objc_storeWeak
and objc_loadWeak
yourself, which is what Cedar is doing here.
I've pushed 9ab7ca0 which seems to resolve the issue by just removing the annotation. The variable names still contain the word weak
so the intention is still reasonably documented. @codeman9 could you check and see if this works on your end?
from cedar.
Under MRC references are assign, not weak -- an important difference if
relying on the value of the pointer (null/not null). An assign reference
can be non-null, but point to garbage, whereas weak is guaranteed to be nil
or point to something valid.
I have a feeling there is reliance on this value distinction in the code
these days, so we should be careful here.
On Sun, Mar 6, 2016 at 05:26 Brian Croom [email protected] wrote:
My understanding of these statements is that the __weak attribute never
actually did anything in MRC, which isn't surprising to me at all. In MRC
all references are effectively weak anyway, it just means that the
auto-zeroing behavior wasn't available unless you called down to
objc_storeWeak and objc_loadWeak yourself, which is what Cedar is doing
here.I've pushed 9ab7ca0
9ab7ca0
which seems to resolve the issue by just removing the annotation. The
variable names still contain the word weak so the intention is still
reasonably documented. @codeman9 https://github.com/codeman9 could you
check and see if this works on your end?—
Reply to this email directly or view it on GitHub
#376 (comment).
from cedar.
Good call @akitchen. I think the salient point here though is that __weak
under MRC has never actually provided zeroing weak references, they were still just standard assign references after all. That's why the code using these variables calls into objc_storeWeak
and objc_loadWeak
to manually invoke the runtime magic that provides the nil-after-dealloc behavior.
from cedar.
Yup, I completely agree. I think the key word here is "magic"
On Sun, Mar 6, 2016 at 07:46 Brian Croom [email protected] wrote:
Good call @akitchen https://github.com/akitchen. I think the salient
point here though is that __weak under MRC has never actually provided
zeroing weak references, they were still just standard assign references
after all. That's why the code using these variables calls into
objc_storeWeak and objc_loadWeak to manually invoke the runtime magic
that provides the nil-after-dealloc behavior.—
Reply to this email directly or view it on GitHub
#376 (comment).
from cedar.
@briancroom The changes you pushed removed the errors for me. Thanks!
from cedar.
Related Issues (20)
- Console output is logged out of order HOT 1
- new project can't find cedar HOT 1
- Use of @import HOT 2
- Custom matchers fails to compile using Xcode 7.3 HOT 4
- Test observation issues HOT 2
- Weak References in XCode 7.3 HOT 4
- Playground support
- Installing template fails on AppCode 2016.1 HOT 1
- Cedar silently accepts misuse of the test structure DSL
- Running Individual Specs HOT 9
- Cedar, Swift and Protocol Declarations - Compiler error HOT 7
- testing watchOS with Cedar and Swift
- Cedar Standalone with XCode 8/ios-sim 5.0.8 HOT 4
- Cedar needs a sticker. HOT 4
- should equal throws exception when comparing const pointer to a non-const pointer HOT 5
- Cedar status HOT 1
- Xcode 9 compatibility HOT 8
- [Known Issue] Cedar's test specs cannot be folded in Xcode 9
- spy_on NSDate crashes on Xcode 10 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cedar.