- (void)printCaption;! ! @end @implementation Photo! ! - (void)printCaption! {! NSLog(@"I have no caption!");! }! ! @end class Photo { public function printCaption() { echo 'I have no caption!'; } }
initWithCaption:@"Fart!"];! ! NSString *caption = [photo caption];! NSLog(@"The caption is: %@", caption);! ! [photo release]; $photo = new Photo('Fart!'); echo 'The caption is: ' . $photo->getCaption(); The cap&on is: Fart!
method call will just do nothing. For methods that return something, nil will be returned. Photo *photo = nil;! ! [photo printCaption]; // does nothing! ! NSString *caption = [photo caption]; // nil!
should have these methods: • canCreateUsers -‐ returns a boolean (BOOL) with value NO. • fullName -‐ returns a concatenated first name and last name. Returns an NSString. The class should have an init method where the first name and last name can be passed. Create a subclass of FUser and name it FAdminUser. The method -‐canCreateUsers of FAdminUser should return YES. The -‐fullName method should append the string " (Admin)" when returning the result. Make a sample usage (NSLog) in your app delegate.