The @implementation Section
As noted, the @implementation
section contains the actual code for the methods you declared in the @interface
section. You have to specify what type of data is to be stored in the objects of this class. That is, you have to describe the data that members of the class will contain. These members are called the instance variables. Just as a point of terminology, you say that you declare the methods in the @interface
section and that you define them (that is, give the actual code) in the @implementation
section. The general format for the @implementation
section is as follows:
@implementation NewClassName{ memberDeclarations;} methodDefinitions;@end
NewClassName is the same name that ...
Get Programming in Objective-C, Sixth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.