Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import "Photo.h"
  2.        
  3. @implementation Photo
  4.  
  5. @synthesize caption;
  6. @synthesize photographer;
  7.  
  8. - (id) init
  9. {
  10.     if ( self = [super init] )
  11.     {
  12.         self.caption = @"Default Caption";
  13.         self.photographer = @"Default Photographer";
  14.     }
  15.     return self;
  16. }
  17.  
  18. - (void) dealloc
  19. {
  20.     self.caption = nil;
  21.     self.photographer = nil;
  22.     [super dealloc];
  23. }
  24.  
  25. - (NSString*)description
  26. {    
  27.     return [NSString stringWithFormat:@"Photo caption: %@, photographer: %@", self.caption, self.photographer];
  28. }
  29. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement