Objectivist-C是Objective-C的框架,示例代码:
#import<Fountainheader.h> @interfaceHelloWorld//...@end @implementationHelloWorld -(void)printHelloWorld{NSString*hello=@"Iam.Ithink.Iwill.";Printer*printer=[[Printeralloc]init];if(printer){[printerprint:helloinExchangeForUSDollars:2.00];[printerrelease];}else{//InObjectivist-C,objectsareself-sufficient.//Here,Iimplementstringprintingfromscratch.[selfcreateTheUniverse];[selfcreateStandardOutputDevice];[selfprint:hello];}} //... @end点击空白处退出提示
评论