Core Data with UISplitViewController best practice and Prev/Next Button? - objective-c

I need to display the following data structure in Core Data on iPad:
Categories(tableView) -> Products(tableView) (This part with 2 layers of navigation controllers in masterView on the left side of UISplitViewController)
With a particular product selected, display ProductDetail in the detailView on the right side of UISplitViewController.
The challenge is to add Prev/Next buttons in the detailView and navigate through different products within that particular category. Including functions where in portrait mode:
1.when masterView disappears, the Prev/Next are still able to function properly.
2.Say if user currently is at Category1->ProductList1, user navigate back from ProductList1->Categories, did not select any other category, dismisses materViewPopOver. After using Prev/Next to navigate between products in ProductList1, then reopen the masterViewPopOver, original ProductList1 is shown in masterViewPopOver (instead of at Categories level when last dismissed)
Bottom line is, I want it to function exactly like the native iPad Mail app.
Can any one advice what is the bet practice to achieve this behavior?
Should I use only one FetchedResultsController (with many sections) to handle both Categories level and Products level data? Or should I use two (one for each level)? How do I make sure detailView keeps track of the Prev/Next order?
Any input is appreciated! Thanks in advance.

Related

Is the order of view controller objects in the navigator pane relevant?

I am just beginning to develop an app using Xcode 5 and am very much a newbie.
I have a project where I want the keyboard to hide after editing a UITextView object. I have compared it to a working project (Apple's Keyboard Accessory example) and the only difference I can see is the order of objects under the View Controller. I can't figure out how to reorder them, but I am not sure if it is a problem. It appears that the wrong object is being selected as First Responder.
I'd appreciate it if someone could tell me if it is relevant and if so how to reorder the objects.
I'm attaching screenshots of both View Controllers. The Water View Controller screen shot is mine and the other one is the Keyboard Accessory example.
In general it does not really matter the order you see them in Document Outline.
You can change the order by dragging them around.
However, sometimes changing the order of 2 items can make some details become invisible, so make sure you always check any changes you make.
Hope it helped

How to structure code with an animation on part of the view

I want to make an iPad app with multiple "forms" that must be filled out. The view has a header and a footer section that are the same on all views. The middle part contains the form fields. I would like the animation between the pages to be only on the middle part. That is: The header and footer must stay in the view while the middle part slides to the next form.
I can create this easily in code, where I configure all fields that must be inserted in the code and then create the animation. However, this feels wrong and not very maintainable. Therefore, I would like to use the story board to configure each of the form pages. The question is: How do I do this? Do I need one or several View Controllers? How do I best create the views and organize the code?
PS. I work on an iOS 5.0 app
The best way I have found out to do this is to create the views in xib-files. Then the view that should be shown next can be generated from the xib-file. All is done in one view controller (since a new view controller would take over the entire screen). This is easily maintainable and easy to animate.

How to create a master view for an iPad app

What I'm looking to do is create some kind of master view, that would have the same header (with a logo), footer (with some text and a button), background image and navigation (not a navigation bar, just a few buttons) on every view.
You could think of what I'm after doing is like a PowerPoint presentation. Create a master slide that's layout is used through every slide, you create a new slide and it takes across all the masters properties (header, footer, background etc) and then it's just the content that changes on each new slide.
However, I'm not too sure how I would do this in an iOS application. I've had a look on Google searching many different phrases but all seem to be about iPad split views and using cells of a tableview, which isn't what I'm after.
All I can think to do is create a single view controller class, with a view, and then add a sub UIView for each page I want (about 15-20), but with the one class, and every page having different content and a lot of code required for each one, that's going to get messy! Or I simply recreate the footer and header etc on every view controller, so if there were to be a change, then I'd have 20 views (more if it grows) to edit! So I'm just wondering if there's a simple way of getting what I'm after.
The app will be for iPad only, and I can use any OS up to 5, so xibs or storyboards are fine. And this won't be on the app store if that helps.
I've done a quick drawing below. The master view with all my bits to be used on each page, and then content slides that will slot in and out of the mater's content area.
Check out Containment View Controllers. This kind of presentation is exactly what they are designed to handle. There is a really nice WWDC presentation from 2012 I believe that illustrates how these work. There are also several tutorials online if you search.
maybe the best option is to create a master detail page. Then for each new page, call the master?
If u want to show header and footer view in whole apps then add header and footer view in window not in view controller i think it will work

Controls/Design Pattern to use for an iPad app with two levels of tables leading to a detail view

I have an e-commerce site I'm trying to produce an iPap specific app for and am struggling with the best way to recreate the menu structure. We have a top level menu that lists product categories. Clicking on that displays the list of products in the selected category. Clicking on the product takes you to the product detail page.
It seems like a great place for a UISplitViewController but I'm struggling with the two levels of browsing. Should I do a single table controller for the product categories taking you to a UISplitViewController with the product list and product detail? Or just two separate tableviews leading to a normal view and not mess with the splitview? How have other app handled this? I'm honestly not that much of an iPad user, so I'm not familiar with how other apps have done this type of thing.
If you are prepared to only target iOS 6+ you could wait and use the UICollectionView. Then you could implement something similar to the photos app on the iPad with pinching/zooming and turning of products (instead of photos). The WWDC 2012 videos have examples to view and go through example code.
If you have to target iOS 4+, UISplitView will also do the job in a more straightforward fashion.
The design with the UISplitViewController is what you should go for. You can then deal with your hierarchy incode more or less like you would on an iPhone with a plain navigation controller.

Is it possible to create a mixed Master-Detail and Tabbed bar application with Xcode?

I'm trying to create a Master-Detail iPad application with a list of saved files in the Master view, and the main interface in the detail view. There will be many different views in the detail, however, and I would like to be able to use a tab bar so users can quickly move between detail views. Is it possible to create a tab bar to navigate just between the different detail views, and still keep the same master view? I could just put in a "main menu" type view, which would have buttons to get to all the different main interfaces, but I'd like to avoid doing that if I can.
Thanks!
Mike
From everything I've seen, this type of layout isn't possible, and isn't really consistent with what a split view should be used for. The more appropriate way to do this would be to use standard UIViews in a UITabBarController, then having the saved files as it's own view opened in a popover.