@interface Gun : NSObject{
@public NSString *_size; int _bulletCount;
}
-(void)shoot;
@end
@interface Soldier : NSObject{
@public NSString *_name; int _level; } -(void)firebyGun:(Gun *) gun;
@end
#pragma implementation
@implementation Gun
-(void)shoot{
NSLog(@"%@正在突突的射击",_size); }
@end
@implementation Soldier
-(void)firebyGun:(Gun *) gun{
[gun shoot]; NSLog(@"此时剩余的子弹数",_bulletCount); 此处为什么报错啊?? }
@end
|