#import <Foundation/Foundation.h> @interface EOCPerson : NSObject @property (nonatomic , copy , readonly) NSString *firstName; @property (nonatomic , copy , readonly) NSString *lastName; @property (nonatomic , strong , readonly) NSArray *friends; -(id)initWithFirstName:(NSString *)firstName andLastName:(NSString *)lastName; @end //分類 //@interface EOCPerson (FriendShip) //-(void)addFriend:(EOCPerson *)person; //-(void)removeFreind:(EOCPerson *)person; //-(BOOL)isFriendsWith:(EOCPerson *)person; //@end @interface EOCPerson (work) -(void)performDaywork; -(void)takeVacationFromWork; @end @interface EOCPerson (Play) -(void)goToTheCinema; -(void)goToSportsGame; @end #import "EOCPerson.h" @implementation EOCPerson @end
#import "EOCPerson.h" @interface EOCPerson (Friends) -(void)addFriend:(EOCPerson *)person; -(void)removeFreind:(EOCPerson *)person; -(BOOL)isFriendsWith:(EOCPerson *)person; @end #import "EOCPerson+Friends.h" @implementation EOCPerson (Friends) -(void)addFriend:(EOCPerson *)person{ } -(void)removeFreind:(EOCPerson *)person { } -(BOOL)isFriendsWith:(EOCPerson *)person { return YES; } @end