objective c - one .h multiple .m files -
good evening, need know how can have 1 .h file defines class , multiple .m files same class! project big , loosing it:s. can please paste simple example?
sincerely
l_sonic
use categories:
foo.h
@interface foo : nsobject // properties // public methods @end
foo.m
#import "foo-bar.h" @implementation foo // public method implementation @end
foo-bar.h
#import "foo.h" @interface foo (bar) // private method interfaces @end
foo-bar.m
#import "foo-bar.h" @implementation foo (bar) // private method implementation @end
in implementation foo, can access of methods defined in foo (bar)
keep in mind properties , ivars must defined in foo
you can continue eg. foo (duck)
another option put
#pragma mark - title
in code. can use jump bar (at top of file editor) group methods
Comments
Post a Comment