Ho notato una varietà di dichiarazioni @interface
per classi Objective-c. Mi piacerebbe capire perché gli sviluppatori dichiarano @interface
nei seguenti modi:Varietà di dichiarazioni @interface, alcune con parentesi
// in the .h file
@interface MyClass : NSObject
// ...
@end
// in the .m file (what's the purpose of the parens?)
@interface MyClass()
// more property declarations which seem like they can go in the .h file
@end
// again in the .m file (what's the purpose of private?)
@interface MyClass (Private)
// some method declarations
@end
Per esempio: [una rapida ricerca] (http://stackoverflow.com/search?q=%5Bobjc%5D+%40interface+parentheses&submit=search) salta fuori http : //stackoverflow.com/questions/7378479/what-does-the-text-inside-parentheses-in-interface-and-implementation-directive –
Che dire di guardare le [specifiche della lingua] (http://developer.apple .com/library/mac/documentazione/cacao/concettuale/ObjectiveC/capitoli/ocDefiningClasses.html # // apple_ref/doc/uid/TP30001163-CH12-SW1)? –