views:

51

answers:

2

I'm creating a magazine type application for the iPad and want to make sure I am using the best approach. I want to have a global custom header and footer that is always present regardless of what view is displayed. Right now I am thinking I will have my main view with three subviews: header, footer, and body. Because of the graphical nature of the application I will be using nibs for each view. The header and footer subviews will each have a single nib, and the body subview will load and unload views using initWithNibName. This way I can allow view transitions on the body while the header and footer remain static.

My question is does this seem like a good choice in regards to memory management and development? I can't use xcode's built-in nav bars and tab bars because I want more control over the design and I think i will lose control over having just the body transition in and out.

Hope this makes sense. If anyone has any thoughts, comments, other approaches, etc, I would love to hear them. Or if anyone knows of any sample apps that have this type of functionality please post a link.

Thanks,

Bryan

A: 

Just make sure one thing. When body view is changing, you must release the previous view. The design seems OK to me. May be other members can suggest better design.

taskinoor
A: 

It seems like a good choice if you can't use the built-in UINavigationViewController. In terms of memory management it will likely be the same. I can't comment on the development effort for your particular scenario, but as a rough estimate it should be fine since custom views are easily composable.

There's one caveat though: There are certain undocumented behviors inside a UINavigationViewController (when it comes to handling subviews) that a normal UIViewController doesn't have. See http://stackoverflow.com/questions/2953351/iphone-landscape-faq-and-solutions.

Johannes Rudolph
Thanks for the feedback guys. I wanted to make sure I wasn't missing some obvious alternative. Or should I say obvious to a more experienced iphone developer. ;) And thanks for the link Johannes, I will give that a read
Bryan Sorensen