iOS how to structure helper class -


i have 2 classes: 1 primary 1 , 1 helper class. helper class subclasses uitableviewcontroller , has no purpose outside of implementing functionality primary class. unsure how structure this. coming java background, natural approach think of inner class reading other posts doesn't exist in ios. proper way structure this? declare helper class own standalone class in separate .h/.m files implicit understanding helper class?

there no inner or nested classes in objective-c. need make helper separate top-level class.

you can put helper in own .h/.m files, or, since primary class needs see it, can put entirely in primary class's .m file. is, can this:

// in primary.m  #import "primary.h"  @interface primaryhelper : uitableviewcontroller // primaryhelper interface declarations here @end  @implementation primaryhelper // primaryhelper implementation here @end  @implementation primary // primary implementation here @end 

however, if helper class implementation more 30-40 lines, find easier manage if put in own files.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -