Objective C Interfaces by Example
Interfaces are basically class declarations that reveals the accessible properties and methods. A sample interface for Class car is shown below.
/* Every class interface starts with
@interface keyword followed by class name.
NSObject is the root class of all classes.
*/
@interface Car:NSObject
{
// Instance variable
int modelNumber;
}
// Properties declaration
@property(nonatomic, strong) NSString *modelName;
// Method declaration
- (void)start;
/* Every class interface ends with
@end keyword.
*/
@end