One liner?


#1

It seems like the solution to this is essentially a one liner:


#2

That’s perfect - I had solved the challenge using multiple lines and was looking for a more concise flavor. Got tangled with the brackets until I saw your solution.


#3

Nice. I like it.


#4

NSString *localizedName;

int main(int argc, const char * argv[])
{

@autoreleasepool {
    
NSHost *currentHost = [[NSHost alloc]init];
    NSLog(@"The name of this computer is %@", currentHost.localizedName);
    
}
return 0;

}

Soooo jealous, look at all the lines I had to use.