C#妹妹:阿姨,今天這麼早就出來遛狗了??
Objective-C阿姨:是啊,我的狗老了,有點失眠,起的是早點...你看看,這個狗狗特聰明特聽話
html#viewSource" commandName="viewSource" highlighterId="highlighter_203663">view sourceprint?
//********* 文件Dog.h ***************
#import <Foundation/Foundation.h>
typedef
enum
{<BR> kBlackColor,<BR> kYellowColor,<BR> kWhiteColor<BR>}Color;
view sourceprint?
@interface
Dog :
NSObject
{
Color Color;
int
Age;
}
-(
void
) Sound;
-(
void
) Eat:(
NSString
*) food EatQty:(
int
) count;
@end
//Dog
-
view sourceprint?
//
//********* 文件Dog.m ***************
#import "Dog.h"
@implementation
Dog
-(
void
) Sound
{
NSLog
(@
"汪汪!"
);
}
-(
void
) Eat:(
NSString
*) food EatQty:(
int
) count
{
NSLog
(@