I just noticed there is no * in front of the declaration for a delegate …
I did something like this :
@protocol NavBarHiddenDelegate;
@interface AsyncImageView : UIView {
NSURLConnection* connection;
NSMutableData* data;
UIActivityIndicatorView *indicator;
id <NavBarHiddenDelegate> delegate;
}
@property (nonatomic, assign) id <NavBarHiddenDelegate> delegate;
- (id)initWithUrl:(NSString*)url;
@end
@protocol NavBarHiddenDelegate
- (void)hideNavBar;
@end
It works perfectly well but as I am used to always but a * in front of objects I declare, why not for this one ?!?
Thank you,
Gotye.
This has nothing to do with delegates.
The type
idis different, for historical reasons; think of it asany-object *. Whenever you writeid, there is no*.If there were a single root class
Objectfor all Objective-C objects then you could imagine thattypedef Object * id;— but there isn’t, soidis different (well, actually, it’s defined as something likestruct objc_object *if I recall correctly, but you shouldn’t worry about that implementation-detail-with-respect-to-this-level).