Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Interface implementation
//gcc 5.0.4 #import <Foundation/Foundation.h> @interface Person:NSObject{ NSString *personName; NSInteger personAge; } - (id)initWithName:(NSString *)name andAge:(NSInteger)age; - (void)print; @end @implementation Person - (id)initWithName:(NSString *)name andAge:(NSInteger)age{ personName=name; personAge=age; return self; } - (void)print{ NSLog(@"Name:%@",personName); NSLog(@"Age:%ld",personAge); } @end int main(int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; Person *person=[[Person alloc]initWithName:@"Marees" andAge:5]; [person print]; [pool drain]; return 0; }
run
|
edit
|
history
|
help
0
Sum Example
shape example
BookAuther
NSMutable Example
objective c fibonanci
objective c fibonanci
01 Hola mundo
string mutable
array
NSMutable Chirag