Graphics Programs Reference
In-Depth Information
Figure 2.13 The isa pointer
The isa pointer is where Objective-C gets much of its power. At runtime, when a mes-
sage is sent to an object, that object goes to the class named in its isa pointer and says, “I
was sent this message. Run the code for the matching method.” This is different than most
compiled languages, where the method to be executed is determined at compile time.
Implementing the designated initializer
Now that you have declared the designated initializer in BNRItem.h , you need to imple-
ment it. Open BNRItem.m . Recall that the definitions for methods go within the imple-
mentation block in the implementation file, so add the designated initializer there.
@implementation BNRItem
- (id)initWithItemName:(NSString *)name
valueInDollars:(int)value
serialNumber:(NSString *)sNumber
{
 
Search WWH ::




Custom Search