| Issue 3: | Doesn't seem to accept Objective C syntax |
1 of 2
Next ›
|
| 2 people starred this issue and may be notified of changes. | Back to list |
This is what I tried and it doesn't compile whereas It does on Mac:
#import <Foundation/Foundation.h>
@interface Person: NSObject {
int _age;
NSString* _name;
}
-(void) setAge:(int) age;
-(int) getAge;
-(void) setName:(NSString*) name;
-(NSString*) getName;
@end
@implementation Person
-(void) setAge: (int) age{
_age = age;
}
-(int) getAge{
return _age;
}
-(void) setName: (NSString*) name{
_name = name;
}
-(NSString*) getName{
return _name;
}
@end
@interface Main : NSObject {}
@end
@implementation Main
+(void)main {
NSString *mystring = @"Hello world !";
NSLog(@"mystring : %s",mystring );
Person* aPerson;
aPerson = [Person new];
[aPerson setName: @"Smith"]
NSLog(@"Name : %s",[aPerson getName]);
}
@end
Jun 20, 2011
#1
zapzu...@gmail.com
|