Three20-Popup a detail view controller and add new item to data source - iphone

I am new to three20 and iphone development. I want to achieve a real simple function. I have a TTTableViewController which binds to TTListDataSource. I also have an add(+) button on top right corner. When that add button is pressed, I want to pop up a detail view for the user to enter the information. Then after the user navigate away from the detailed view by saving, the TTListDataSource will be updated with user entered data.
I looked over the examples provided by Three20 library, and didn't find a good example for this. Can anyone provide some clue on how to achieve this functionality?

If you're new to the ios development, I suggest you start with some basic & coredata tutorials before jumping into the three20 framework. Three20 is mostly about UI elements and easier to manage controllers navigation.
I believe Three20 doesn't has any storage / database framework, so you will have to use the standard core data apple provide. Here's a good example project with a table view & add feature:
http://developer.apple.com/library/ios/#samplecode/CoreDataBooks/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008405
After you have good understanding of the core data framework, it will easier to implement using three20.

Related

Create springboard like main view

Is there some sample code, or an easy way, to implement an application with as its first view something like Springboard?
What I am looking for is just a view with basic icons which after a tab on an icon tells the view-controller to push the view associated with the selected icon.
This in itself is not that difficult off-course (just putting images on a view), but is there an easy way to implement all the extra functionality as well (as e.g. moving the icons around (start 'vibrating' when when you push hold them), multiple pages etc.). The Facebook App seems to have this. It is probably not worth my while to write it myself, but it would be nice if there is something 'out of the box' to give the App a bit more of an iPhone feel.
Thanks in advance!
Facebook uses the Three20 library for its UI. The specific view used for the SpringBoard-like interface is known as TTLauncherView.
This is not an endorsement (I have yet to really check this out, and I may be too entrenched in using Three20 at this point to even bother), but here is another project that implements the springboard functionality: myLauncher on Github
You can use UICollectionView to create this
Look at this example
https://github.com/tularovbeslan/Springboard

Iphone sdk - How to setup a 'template'

I've been working on a Cook Book App and I've been making each page individually which takes a really long time to do, I asked a question similar to this and it was brought to my attention that you can setup a way to automate the design process so all you need to do is input your data.
Can someone please explain in as much detail as possible how you setup your xcode files/code to automate such a process
So for example I would just enter the page text and it would automatically put my standard background picture in and add a scroll view and appropriate buttons etc.
Thanks
You could make one master view that contains all the controls that you need: standard background picture, scroll view, appropriate buttons, etc, and make any subsequent views that you create inherit from this view, so that they all contain those controls.
You could also use just one view and work with multiple instances of it, one instance per page. Just make sure to have a Text property on it, or a constructor that takes in your text string, so that you could set it to a different text on each page.
Xcode project templates and file templates are pretty easy to make, with a few caveats.
Check the answers to these questions:
Add new templates in Xcode
Change templates in XCode
Also take a gander at these handy tutorials:
Custom Xcode Templates
Xcode: How to customize the existing project templates
It sounds to me like your putting your data into your views (pages). That's a big design error. You need to employ the Model-View-Controller design pattern and separate your data from your views. That will make it easy to create one view (template) that you can reload with data to display each individual recipe.
The first thing to do is to separate your data from the view. You need to have the recipes stored in an array, dictionary, Core Data etc and then wrap that data in a dedicated object. The second thing to do is to create a dedicated view to display all the recipes. As the user moves from recipe to recipe the app will simply remove and add information to the same view as needed.
I would recommend Cocoa Recipes for Mac OS X: The Vermont Recipes, Second Edition because it addresses these issues and it uses a recipe type app as its example. It's for Cocoa but the basic principles apply to iPhone apps as well.

Is it possible to turn a View-Based App into a navigation-Based App?

I am close to finishing my first application (a UITableView style one) on the iphone but have realised it will look much better, and stand a far better chance of getting through the approval process, if it is presented as a navigation-based app rather than a view-based one - in hindsight my initial choice is not really suitable...
Is it possible for me to somehow change easily the application into a new type, or would i be better starting again from scratch with all the hassle that would entail...
thanks for any advice on how it may be done,
karl
It wouldn't be particularly difficult to shift the means of interaction to a navigation controller from a simple view controller (it also isn't difficult to go the reverse direction). Although, there isn't anything as simple as a tutorial on how to do it or menu item you can select. You could look at the plumbing generated by Apple's template for a navigation based application and add the necessary glue to your app delegate. Once that is in place you could simply push your view based applications view controller onto the navigation stack. If you have more specific questions or are stuck somewhere in particular we can help to get you un-stuck if you provide details about where you are running into issues.
As an aside, I doubt your application will be rejected solely for being view based vs. navigation based.
Hmmmmm, for soem reason t wont let me add anything to comment on your post!
Anyway, i guess this is as good as anything here...
Ive been messing for the last hour or so and have managed to integrate my old code/data etc into a new navigation one without too many problems, in fact it looks nicer with a title bar at the top!
(I do like to try and work stuff out for myself so its a good learning curve!)
I am still struggling in that although the new view opens up i am
struggling to use a string from the first view (I have a UITableview table in there, i select a row and get a correct value from it which i currently check via an alert message) in the second view.
for some reason i do not get a title bar and 'back' button in the 2nd view so i guess it is not being put on the stack correctly (I have put a quick 'return' button in the view for testing purposes so i can navigate backwards and forwards).
Still, Im about 100% further on than i was earlier!
cheers for the reply,
Karl

How can you have a page with a button that change views that is not a table view? (iPhone Developing)

I asked a similar question and someone gave me a tutorial link. But, the link made me use a table view and it looks bad with all the lines and stuff. So how do I just make a view with a button and background and stuff (Please write steps in 1.2.3.. format and it would be nice if you attached the code needed too.)???
It's really difficult to fit that kind of project into a comment field, and, in any case, the best way to learn is to get your hands dirty.
Take a look at the Utility sample project that is built into Xcode. Create a new project in Xcode, and under the iPhone Application templates, select Utility Application. This template project uses a button to switch between two views.

iPhone: Is there a pre-made UISettingsView?

On startup, if the user hasn't done any setting of NSUserDefaults, I want my main view to do a flipside view that brings up the same stuff that shows up in the Settings app.
Is there an API for instantiating the same controller that Settings uses, or will I have to reimplement a table view and controller myself?
This website hosts the 'MySettings' API which is a nice toolkit that encapsulates various Settings features (switches, choices, etc) all in a declarative (plist-based) API.
You have to code the ui elements yourself if you wish to make the perferences available within your app. The utility template in xcode gives you a starting point by making a flipview available.
Check out Craig Hockenberry's Generic Table Views, which make it really easy to set up a Settings-like table view.