@interface HelloWorld : NSObject
- (NSString *)hello:(NSString *)name;
@end
@implementation HelloWorld
- (NSString *)hello:(NSString *)name {
if (!name) { name = @"World"; }
return [NSString stringWithFormat:@"Hello, %@!", name];
}
@end
Objective-C is a thin layer on top of C, and is a "strict superset" of C, meaning that it is possible to compile any C program with an Objective-C compiler, and to freely include C language code within an Objective-C class. Objective-C derives its object syntax from Smalltalk. All of the syntax for non-object-oriented operations (including primitive variables, pre-processing, expressions, function declarations, and function calls) is identical to that of C, while the syntax for object-oriented features is an implementation of Smalltalk-style messaging.
You can find more information about the language and its history here.
Join the Objective-C trackWhat I like about it is that I am able to solve the challenges in a TDD way working in a environment that I am familiar (my own PC not a browser IDE) and the cherry on the top of the cake is that I have access to code reviews.
Once you join the Objective-C language track, you will receive support and feedback from our team of mentors. Here are the bios of a few of the mentors of this track.
These are a few of the 51 exercises on the Objective-C track. You can see all the exercises here.