One liner?


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


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.


Nice. I like it.


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.