1 Sending a message
The real fun is accompanied by the "sending messages" began. Sending a message would be the basic building block of your objective-c apps because it's how do you tell an object to Perfor M some action or to give you some piece of information.
Sending a message requires two things-an object and a message name:
[ObjectName MessageName]; #Square brackets cannot be less
Send a simple message:
[TRYOBJC Completethischallenge];
2 Sending description information
Thetryobjcobject NSString isNSNumbersomething we made up and the objects built-in to Objective-c D NSArray, is real and has a bunch of messages you can send to them.
One of those messagesdescriptionis, and there's something extra cool about it-passing the message returns a result. Not all messages return something, but the message always returns a that represents the contents of thedescriptionNSStringobjec T that you passed the message to.
If you senddescriptiona NSString object, you'll get the characters in that string, and if you send it to a nsarray you ll Get a string containing all of the values in this array.
NSArray *foods = @[@"tacos", @"burgers"];
NSLog(@"%@", foods);
#output:
#challenge[3]: (
# tacos,
# burgers
#)
3 Storing the result of a message
Objective-c Level-2