Objective-C's version of Swift's '_'

iOS   objective-c  

Sometimes you want to create a variable but not use it. Developers using Swift will be familiar with this concept. For example

let _ = createSomethingIDontUse()  

But trying this in Objective-C generates a 'Result unused' error. Unless you do this:

__unused id _ = [self createSomethingIDontUse];  

Comments powered by Disqus