I am learning Objective-C through Cocoa (and love it). I follow the tutorial. There's a class called "Menu" and the interface looks something like this.
@interface Menu: MenuObject {}
@end
@interface MenuLayer : LayerObject {}
-(void) someMethod:(id)sender
-(void) someOtherMethod:(id)sender
@end
and implementations follow the same convention
@implementation Menu
-(id)init{
}
@end
@implementation MenuLayer
@end
Which for me looks like two separate objects / classes that are defined and implemented in the same files. Is there a reason for this? Will the result be the same if I split the .h and .m files into Menu.h / .m and MenuLayer.h / .m? Or do I not understand something fundamental?
source
share