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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -