Created
June 14, 2016 01:58
-
-
Save sam-w/ff7fe830e41b030cb796a2c809af3d32 to your computer and use it in GitHub Desktop.
How many objects before Xcode stops detecting retain cycles?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func makeThing(withRefTo inThing: Thing) -> Thing { | |
let outThing = Thing() | |
outThing.thing = inThing | |
return outThing | |
} | |
func makeChainOfThings(startingWith inThing: Thing, count: Int) -> Thing { | |
guard count > 1 else { return inThing } | |
let outThing = makeThing(withRefTo: inThing) | |
return makeChainOfThings(startingWith: outThing, count: count - 1) | |
} | |
let firstThing = Thing() | |
let lastThing = makeChainOfThings(startingWith: firstThing, count: 48) | |
firstThing.thing = lastThing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment