4 ms·
You still have to know the type, this only works for nil, so if you do "obj.?name" and the obj is not nill but doesn't have a "name" attribute, it'll blow up.
by icebraining 11y ago
You still have to know the type, this only works for nil, so if you do "obj.?name" and the obj is not nill but doesn't have a "name" attribute, it'll blow up.
It's essentially syntax sugar to save time when you want to do something iff the whole chain is filled in.