I am working on an iPhone app that requires sequential flow in order for me to capitalize on user-friendly handling. The application is one large loop of multiple view controllers, where a user advances through the various modules of the app. I have an internal loop within the main application loop that consists of just 2 of the view controllers, and concludes whenever the user decides to proceed onward.
The internal 2-controller loop is what I am targeting with my question. It consists of a table view controller (apply change to the user's selection) and a detail view controller (display the changes). Currently, my issue is with increasing memory usage every time the loop proceeds to one of the view controllers. I've heard that forward class declaration is a good way to handle circular dependencies (2-controller loop), but I haven't seen any working example that applies to my situation. Can forward class declaration be used in my case to effectively loop multiple view controllers, and if so how can I do it?
Below is an example of what I'm thinking I need to employ. Is this reasonable? (I am very new to objective-c and the forward declaration concept)
TableViewController.h
#import <UIKit/UIKit.h>
@class detailViewController;
@interface TableViewController : UITableViewController
{
// Stuff for TableViewController object
}
@end
detailViewController.h
#import <UIKit/UIKit.h>
@class TableViewController
@interface detailViewController : UIViewController
{
// Stuff for detailViewController object
}
@end