Challenge Feedback


Appreciate feedback on my solution.


// Print out name of your computer

#import <Foundation/Foundation.h>

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

    @autoreleasepool {
        NSHost *localHost = [NSHost currentHost];
        NSLog(@"%@",localHost); // Output host data for your computer
        NSString *myHostname = [localHost localizedName];
        NSLog(@"My hostname is %@",myHostname); // Output name of your computer
    return 0;


Seems good to me. I had not tried to get the current host information printed, just the computer name.
Lots more information given in that current host: interesting.