I have the following code:
- (IBAction)mapPressed:(id)sender
{
MapViewController *mapVC = [[MapViewController alloc] initWithNibName:@"MapViewController" bundle:[NSBundle mainBundle]];
mapVC.delegate = self;
[self.navigationController pushViewController:mapVC animated:YES];
}
For MapViewController:
//MapViewController.h
@protocol MapViewDelegate
@required
- (void)selectedPlacemark:(MKPlacemark*)placemark;
@end
//...
@property (nonatomic, weak) id<MapViewDelegate> delegate;
//...
If ARC is enabled, do I still need to set mapVC.delegate to nil? If so, does this mean I'm not supposed to create the MapViewController locally and instead set up an instance variable for the object?