Quote:
Originally Posted by Somerset
Thanks for the heads up on the samples. I'm getting thru the tutorials and samples, but trying to understand everything at first read got me bogged down. I can now push on with your tips knowing it got easy for you.
|
No problem, here's a couple more.
Start with the project from the locations tutorial. There are three samples..
locations, photolocations and taggedlocations.
Taggedlocations is a nice one to start on.
Click on the model to bring up the modeler.
now Try adding an entity
Tagged locations has a single location, photolocations has two entities, An event and a photo, there is a 1 to 1 relationship here.
I would suggest adding a catagory entity, again make it 1 to 1, as every event should be tied to a single category for simplicity. I suppose you could make it 1 to many if you want. ie.. multiple categories for each event.
Click the plus sign under entitiy to add the new entity, now add some fields, make sure you define a relationship on the event (ie. category) between the event and the category.
Now rename all the current entity class or save it somewhere, now generate the new model. A new event class and a category class will be generated. Copy any custom stuff thats in your saved entity class to the new class.
Its best when first learining to let the modeler generate the code, later after you get a hang of it, you can add the class attributes yourshelf.
Now very important, assuming you are working in the simulator go to
yourUser/applications/iphoneSimulator/somelongstring/documents and remove the existing sqllite file.
Now build and test the project.
Play with it, add more entities, more relationships etc.
Read about fetched results sets in the programming docs, and try using that... its really cool.