#import <Foundation/Foundation.h>
@interface Bird:NSObject
{
}
- (void) eat;
- (void) sleep;
@end
@implementation Bird
-(void)eat
{
NSLog(@"吃的方法");
}
-(void)sleep
{
NSLog(@"睡的方法");
}
@end
int main(int argc, const char * argv[])
{
//@autoreleasepool {
// insert code here...
NSLog(@"Hello, World!");
id b[0];
b[0]=[Bird new];
[b[0] eat];
//
return 0;
}
程序无法调用eat方法,提示break point求大神指教
------解决方案--------------------
Bird *bird = [[Bird alloc] init];
[bird eat];
[bird release];