iPhone example to go through - iphone

Can you provide me a basic iPhone example which has the following;
a. It is primarily a navigation-based app (Top-level view, Detail view, etc)
b. It also uses table (to present list of items, item details, add, edit, delete)
c. It uses Core Data for storing the list items
d. Optionally, it would be really great if it uses an API for retrieving some of the table data (otherwise user entered if API does not return).
While I do have individual examples for all these thing, I ma basically looking for an example which kind of combines all these things into a single app.
I have already gone through some of the IOS developer reference and hence would want other combined examples.
Any reference examples would be highly appreciated.
Thanks a lot.

Have you looked through the iOS Sample Code library? You'll find examples of all these. They have TopSongs (API, Navigation Views, Table Views, Core Data) and CoreDataBooks for Core Data.

If you create a project using the Navigation based template and select "Use Core Data" you will get the skeleton of exactly the type of app you want.

Examples covering all of those are on Apple's developer website, developer.apple.com.

I used this one is one, to learn this: http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/#create-db

Related

Is my thinking about mvvm right?

I'm having a little bit of a hard time getting into mvvm. I'm writing a simple app, Notebook. I have one viewmodel, it's name is actually ViewModel. It has an ObservableCollection of Notes inside and methods to save and load those from Isolated Storage. My only Model is Note.cs, it implements INotifyPropertyChanged and I'm of course RaisingPropertyChanged.
I've also got two view, both of them are user controls. One to display list of notes and one to edit the one chosen from the list.
My questions are:
Where do I create an instance of my vievmodel?
How should I implement going from the page with list of notes to the page with detailed view after choosing one Note to edit? At the
moment I'm saving the index of Note in App.xaml.cs, going to the next page and setting
the DetailedView DataContext to the right Note in OnNavigatedTo, but
I don't think it's actually the perfect solution.
Where should I save my Notes? I guess Application_Closing in App.xaml.cs is the right place to do it, but I'd have to have my viewmodel as a global object there, is this the right approach?
Additional question:
I have to add possibility to group notes. I guess that class Group with dictionary (GroupName, howManyNotes) is going to be allright since I don't have to be able to for example write all notes from selected group. Do you think there's a better approach I should think about?
Thanks for respones,
MichaƂ.
I would suggest you take a look at Calibrun.Micro which is a great framework for MVVM. You can get some sample from the CodePlex.
I have used that in a bunch of Project, and will give you flexibility in case if your project grows in size.
Google for Caliburn.Micro sample and you will find a number of sample for all technologies like WPF, Silverlight, Windows Store, Windows Mobile.
Caliburn.Micro CodePlex

How to create a database In iPhone application?

I have a very simple application, and i want to add into it a database. For all of you, to understand what i mean, it should look similar like default application "Contacts" in iPhone. It should contain list of elements (like people names in contact list), and when the user click name, the next view appear, which contain information about contact (and other buttons as well). All of data must be inside of application (not downloading from web pages).
Please help me! I am novice, and i have no clue what i should looking for, not just an array i guess... i will gratefully accept any of advice and links to examples, related to my problem.
PS. My app is not about contacts, its about diet. For example, it should look like: user click element "cheese" in list, and then next view provide information about product (calories, protein, fat etc.)
Take a look at the following free lessons from iTunes U. Paul Hegarty is an excellent teacher. These are dense so I had to watch a couple times, but everything you need is here:
Basic Persistence:
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/node/285
Core Data (Lecture):
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/node/287
Core Data Demo:
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/node/289
These pages have the pdfs, but go to iTunes and download the full lectures for an excellent overview. Also don't miss the CoreDataTableViewController available on the last linked page - handy.
Without this course I would not be an iOS developer, so I can't recommend it highly enough.
Enjoy,
Damien

Simple Core Data Example App?

I am trying to learn about core data on the iPhone, and I am looking for a simple Core Data example app.
The problem is, all the example apps I've seen are either too simple (just one view and one data object), or so full of extra functions that it's hard to see what's relevant (Apple's example apps).
I'm looking for an example app with:
an ordinary cascading to-many relationship (e.g. Company > Departments > Employees)
a simple drill-down interface (e.g. click on a company to see list of departments; click on a department to see list of employees; click on an employee to see name and address)
simple editing (press plus for modal view to add company/department/employee)
... so I can learn the basics about passing contexts between views, NSFetchedResultsController etc.
Does anyone know of such a thing?
Thanks!
Try the example found here: Wiley Code Examples
Click on Chapter 18 - Downloads.
Hope this helps.
Let It Be Known
I would recommend Marcus Zarra's Core Data book and the examples therein. He takes one example app that starts off very simple and incrementally adds complexity.
RecipeCT is the project that I would suggest looking at first. Having the book would help you navigate from project to project as the basic Recipes app transforms.

Common, reusable iPhone-App configuration screen

I'm writing code that will allow my iphone-app to have a "configuration page".
A grouped, scrolling, UITableView... with cells that contain the needed textFields, switches, sliders, etc.
It is an ENOURMOUS amount of code. Is there an easier way?
Is there a way I could create a simple text-file, contain all my desired design choices and have my (reusable) code build the TableView for me?
Or... can I just do the whole thing quicker/easier in Interface Builder instead of code?
Basically there are two approaches here :
you rely on what Apple gives you and implement a Bundle Settings (basically a dictionary that describes how the settings screen should look like), and then , your settings will be in the "Settings" application of the iPhone.
The drawback here is that what apple provides is quite limited and you won't be able to implement some of the most complicated settings you can see in "standard" (pre-installed) apple application settings.
That's why many developers are switching to "inapp" settings thanks to open source FWK or they reimplement everythingh from scratch but it can be a lot of code as you said.
You reimplement your own UIViewController for settings or you rely on some framework that will provide you the UIViewController to extend from and ease your implementation.
There are 2 good frameworks for that (Jesse cited one of them, but there's another one )
InAppSettings ( http://inscopeapps.com/blog/inappsettings-10/ )
InAppSettingsKit ( http://inappsettingskit.com/ )
A comparison of the two framework can be found here : http://inscopeapps.com/blog/inappsettings-vs-inappsettingskit/
(ok that's from one of the two authors but at least this gives an idea ;)
If you can live with the limitations of the standard application preferences in iPhone, you can actually create this using a settings bundle which only needs a plist and optionally a localized strings file.
You can check out Apple documentations for this:
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationSettings/ApplicationSettings.html
Claus
If you're looking for a ready made and reusable solution, you can check
http://www.inappsettingskit.com/
It's open source too, so it's useful as a base.
I never found an easy and efficient way to build complicated table view by using Interface Builder, so I think programming the settings view is more preferable.
If you're talking about using a text file or plist, you may want to mimic the Settings Bundle design of Settings app.
Load the plist data upon the app launch.
I've built something like what you're looking for. Going off Claus's answer as well, it basically just duplicates the interface of the Settings application using the same settings.plist file as the settings app. The only difference is that it's a view controller that you can put inside the app. There's a surprisingly small amount of coding involved, it was just a lot of looking at the settings app to see exactly how things were laid out.

How to Choose which Xcode Template to Use?

what if i have ecommerce application?
like i have
1)sale page
2)list of product page(grid view and list view)
3)detail of product
4) zoom images for that product.
what kind of template should i use?
i refer this post but its not clear.
New iPhone App - How to Choose which Xcode Template to Use?
Thanks
If you have a hierarchy of views in which you go from general to specific information, then you want the navigation template.
However, most of the time, the templates are just starting points for learning. In most cases, you will have an app that is a combination so you start with the generic windows-based template and then flesh it out yourself.
If there is a similar application on the AppStore you may like to see how they have approached it, generally there is something similar that can help you clarify how you would like your application to function.
From the sounds of your application idea you would probably be best served by the Navigation template. But after all it is only a template, you can completely change the structure of the application later without needing to start another project.