@property, ok in this situation?
Posted
by fuzzygoat
on Stack Overflow
See other posts from Stack Overflow
or by fuzzygoat
Published on 2010-06-02T15:28:11Z
Indexed on
2010/06/02
15:34 UTC
Read the original article
Hit count: 198
I am still finding my feet with objective-c and was wondering if its acceptable to use @property on the two objects below.
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface MapViewController : UIViewController <MKMapViewDelegate, CLLocationManagerDelegate> {
CLLocationManager *locationManager;
IBOutlet MKMapView *googleMapView;
}
@property(nonatomic, retain) CLLocationManager *locationManager;
@property(nonatomic, retain) MKMapView *googleMapView;
@end
One of my reasons for using them is so that I can use the setters in my viewDidUnload, I seem to be using @property a lot and was just wondering if the use in this situation is acceptable?
-(void)viewDidUnload {
[self setLocationManager:nil];
[self setGoogleMapView:nil];
[super viewDidUnload];
}
much appreciated
Gary
© Stack Overflow or respective owner