Objective-C partial implementation of classes in separate files

流过昼夜 提交于 2019-12-05 07:00:22

You may also want to look at mogenerator, which takes a different approach to generating classes for entities.

Till Theis

In Objective-C you have categories (and extensions).

If your CoreData class is named Person your implementation could go into the category Implementation but note that you have to declare all your ivars in the main interface of your class.

// Person+Implementation.h
#import "Person.h"

@interface Person (Implementation)
- (void)myMethod;
@end


// Person+Implementation.m
#import "Person+Implementation.h"

@implementation Person (Implementation)
- (void)myMethod {
    NSLog(@"hi there");
}
@end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!