I m attending the course of IOS development on itunesU (from Stanford University).
And i got a big doubt about an attribute of a class created in one of this lectures. Let me explain with some code :
我有“面对面意见”这一类,其使命是求取一面,该类的一个属性是“替代”,这是必须执行面对面意见的一个目标。
这里是接口守则:
#import <UIKit/UIKit.h>
@class FaceView;
@protocol FaceViewDelegate
-(float)smileForFaceView:(FaceView *)requestor;
@end
@interface FaceView : UIView {
id <FaceViewDelegate> delegate;
CGFloat scale;
}
@property CGFloat scale;
@property (assign) id <FaceViewDelegate> delegate;
@end
I can t understand why delegate is not a pointer to object, but directly an object. Someone could kindly tell me more about this implementation choiche? is this correct ? why ? Thank you so much!