Reputation: 11317
I have the following code in the interface file:
#import <UIKit/UIKit.h>
#import <AddressBook/AddressBook.h>
@class FaxRecipient;
//Definition of the delegate's interface
@protocol AddLocalRecipientsTableViewControllerDelegate
-(void)getLocalRecipient:(FaxRecipient*)recipient;
@end
@interface AddLocalRecipientsTableViewController : UITableViewController {
NSMutableArray *localRecipientItems;
NSURLConnection *connectionInprogress;
UIActivityIndicatorView *activityIndicator;
NSIndexPath *lastIndexPath;
FaxRecipient * faxRecipient;
}
@property(nonatomic,retain) NSIndexPath *lastIndexPath;
@property(nonatomic,retain)FaxRecipient * faxRecipient;
@property (nonatomic, assign) id<AddLocalRecipientsTableViewControllerDelegate> delegate;
-(void) loadLocalRecipients;
I have the following line in my implementation file:
@synthesize delegate=_delegate;
What does the synthesize with the underscore mean? I mean I know what a regular synthesize does. Everything works OK and I looked at this code example at some other site.
Upvotes: 0
Views: 268
Reputation: 10106
Your properties almost always have a backing variable. What
@synthesize delegate=_delegate;
does is declare that the backing variable for your search bar will be called _searchBar. This allows you to decouple the name of the property from the name of your variable. In fact, if you don't use @synthesize you don't need to have a backing variable at all.
This can:
Upvotes: 0