Weitere ähnliche Inhalte Ähnlich wie Ipad software development (20) Ipad software development14. “ Native application An application whose executable code is in the instruction set architecture of the CPU” Apple Legacy Document 15. “ Native application An application whose executable code is in the instruction set architecture of the CPU” Apple Legacy Document Java app: (Chỉ) cần Java Runtime Web app: (Chỉ) cần a browser Native app: (Phải) cần CPU, OS riêng 24. Objective-C Hello World $ cat hello.h #import <stdio.h> #import <objc/Object.h> @interface TestClass : Object - (void) getMessage; @end $ cat hello.m #import "hello.h" @implementation TestClass - (void) getMessage { printf("Hello Objective-C"); } @end int main(int argc, char *argv[]) { id obj = [ TestClass alloc ]; [ obj getMessage ]; return 0; } $gcc -o hello hello.m -lobjc $ ./hello Hello Objective-C 25. [vuhung@vinicorp 046.ipad]$ gcc -o class_test class_test.m -lobjc class_test.m: In function ‘-[Person setData::]’: class_test.m:27: warning: local declaration of ‘name’ hides instance variable class_test.m:28: warning: local declaration of ‘age’ hides instance variable [vuhung@vinicorp 046.ipad]$ ./class_test Vinicorp 26 26. [vuhung@vinicorp 046.ipad]$ gcc -o new_test new_class.m -lobjc [vuhung@vinicorp 046.ipad]$ ./new_test instanciate!!! destruct!!! instanciate!!! destruct!!! 44. Change History No Date Author Details Comment 1 2010/08/06 vuhung Tạo mới 2 2010/08/16 Vuhung Bổ sung chi tiết các slide