Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 15. Numbers, Strings, and Collections > Synthesized AddressCard Methods

Synthesized AddressCard Methods

Now that we’ve discussed the correct way to write the accessor methods setName: and setEmail:, and you understand the important principles, we can go back and let the system generate the accessor methods for you. Consider the second version of the AddressCard interface file:

#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>

@interface AddressCard: NSObject
{
   NSString    *name;
   NSString    *email;
}

@property (copy, nonatomic) NSString *name, *email;
-(void) print;
@end


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint