#import
@interface Stuent : NSObject
{
int age;
NSString * name;
}
@property int age;
@property(nonatomic,retain) NSString * name;
//-(void)print;
@end
#import "Stuent.h"
@implementation Stuent
@synthesize age;
@synthesize name;
@end
#import "Stuent.h"
@interface Stuent (New)
-(void)info;
@end
#import "Stuent+New.h"
@implementation Stuent (New)
-(void)info
{
NSLog(@"%@,%d",name,age);;
}
@end
#import
#import "Stuent.h"
#import "Stuent+New.h"
int main(int argc, const char * argv[])
{
@autoreleasepool {
// insert code here...
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Stuent * student = [[Stuent alloc] init];
student.name = @"lilei";
student.age = 24;
//[student print];
NSLog(@"Hello, World!");
[student info];
[student release];
[pool drain];
}
return 0;
}