tutorial I am working on defining the following method.
- (void)addBirdSightingWithSighting:(BirdSighting *)sighting { [self.masterBirdSightingList addObject:sighting]; }
The tutorial describes the following:
This method creates and initializes a new BirdSighting object by sending the initWithName:location:date: name and location the user entered along with the current date to the initWithName:location:date: . This method then adds a new BirdSighting object to the array.
There is an initWithName:location:date: method, which is in the BirdSighting class, which is my data model. The above method is added to the data controller, which simply adds the BirdSighting object to the BirdSighting variable array.
I donโt understand that the tutorial says that the BirdSighting object BirdSighting sent to the initWithName:location:date: method when I donโt see it?
- Is it because
* in the method parameter (BirdSighting *) ? I understand that * is a pointer to an object, but does it create a new object and call its init method by default? And just because I added the initWithName:location:date class to the BirdSighting class, did it automatically become the default init method?
source share