Hi all!
I have been developing awhile for iPhone now and have really tried to understand the structure to use when organizing a programming project.My problem is that it seem to be described in so many different ways. I have 2 books and have also followed several tutorials on the internet. Additionally I have read and modified the sample code from apple, in order to try to understand but the result is me being a bit confuced
My problem is perhaps abit easier to understand if I make an example:
I have a first view with a tabBar (below the actual content). When pressing one of the items on the tabBar another view should appear. This is easy and could be implemeted like the tabBar ex. from apple. The problem is that those views appearing when I press the tabBar items, also content views, like mapViews, tableviews and other stuff. The tabBar should be visible in each and every view that appears on the screen.
I started to build every single view and my intention is to let the views to be independent of each other. Every view has a viewcontroller.h and .m and I have created proper classes used by the views, like parser classes and other things. This is rather trivial, but the problem is to get it all work together. Should I see every view as described above, as a independent application, in the total application. If yes - should every view have its own appDelegate defined as a file?
Summerized questions are:
1) How do I structure many independent views optimally to work in one application?
2) Should there be only one appDelegate or should I define one for each viewcontroller? In a bigger project is it possible that the viewcontroller has an object created from another viewcontroller... for example: view2 contents a mapview and the view2 is visible in the mainview. View1 contents a tableView and by clicking on the tabBar (should the tabbar be aview to?) the view1 or the view2 are called and displayed...
3) The "main-view" is one of the views - aka the first view that will appear on the screen... If I would like to change to another view, do i have to create an object of the other view in this first view and make it a subview of the first view? Or should I in the appDelegate make all the views subviews of the window? If yes - where do I control whicht view to be visible at the moment? My thought here was to, when tapping one of the items on the tabbar, the current subview attatched to the tabbar item should be moved to the front like:
I hope that someone could help me out here, because I really do want to understand this in order to make my apps more effective and roboust.
Thanks in advance!
MACloop
I have been developing awhile for iPhone now and have really tried to understand the structure to use when organizing a programming project.My problem is that it seem to be described in so many different ways. I have 2 books and have also followed several tutorials on the internet. Additionally I have read and modified the sample code from apple, in order to try to understand but the result is me being a bit confuced
My problem is perhaps abit easier to understand if I make an example:
I have a first view with a tabBar (below the actual content). When pressing one of the items on the tabBar another view should appear. This is easy and could be implemeted like the tabBar ex. from apple. The problem is that those views appearing when I press the tabBar items, also content views, like mapViews, tableviews and other stuff. The tabBar should be visible in each and every view that appears on the screen.
I started to build every single view and my intention is to let the views to be independent of each other. Every view has a viewcontroller.h and .m and I have created proper classes used by the views, like parser classes and other things. This is rather trivial, but the problem is to get it all work together. Should I see every view as described above, as a independent application, in the total application. If yes - should every view have its own appDelegate defined as a file?
Summerized questions are:
1) How do I structure many independent views optimally to work in one application?
2) Should there be only one appDelegate or should I define one for each viewcontroller? In a bigger project is it possible that the viewcontroller has an object created from another viewcontroller... for example: view2 contents a mapview and the view2 is visible in the mainview. View1 contents a tableView and by clicking on the tabBar (should the tabbar be aview to?) the view1 or the view2 are called and displayed...
3) The "main-view" is one of the views - aka the first view that will appear on the screen... If I would like to change to another view, do i have to create an object of the other view in this first view and make it a subview of the first view? Or should I in the appDelegate make all the views subviews of the window? If yes - where do I control whicht view to be visible at the moment? My thought here was to, when tapping one of the items on the tabbar, the current subview attatched to the tabbar item should be moved to the front like:
PHP:
- (void)bringSubviewToFront:(UIView *)view
I hope that someone could help me out here, because I really do want to understand this in order to make my apps more effective and roboust.
Thanks in advance!
MACloop