Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

grandM

macrumors 68000
Original poster
Oct 14, 2013
1,551
309
If I remember correctly nil in Objective-C meant the pointer was not set to any place in memory yet. Once you initialized the object you could set the pointer to the particular instance being the object.

But what is nil in Swift? Is it also a pointer not set?
 
I'd be interested in learning that as well, but I don't know that you'll get the answer you're looking for, beyond what's written in the Swift guide:

Swift’s nil is not the same as nil in Objective-C. In Objective-C, nil is a pointer to a nonexistent object. In Swift, nil is not a pointer—it is the absence of a value of a certain type. Optionals of any type can be set to nil, not just object types.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.