Tuesday, October 19, 2010

19 October 2010 - More Core Data

Been working with Core Data for the whole day! Finally completed Assignment 4 Part 2. The way of adding data into Core Data is different from what we did in our previous applications via Visual Studio. The toughest part of this assignment was to know how to write and retrieve proper data in/out of Core Data. Once we got the concept right, the rest of the assignment wasn't much of a problem at all.

We thought that the way we retrieved and stored data with Core Data was the right way yesterday. However, there were some issues that surfaced after some analysis. What we have done is to add the separate entities, namely Person and Photo. However, all that we need to do is to actually add the Person entity, as Person contains a set of Photos. We just had to properly assign the NSSet of Photo instances to the Person, and add Person into Core Data. The relationship would be established automatically by the database system.

Through much researching and looking at sample codes, as well as Kevin's help, we got to understand how Core Data is being implemented. Zac and I also helped each other in the implementation and debugging. We went ahead to derive an algorithm that saves and retrieves data properly using Core Data. This time round, we're very sure that everything is right.

All along we've been working with delegates, just that I didn't know what that was called - until Kevin explained what delegation was all about. It's one of those design patterns out there, where the methods being implemented by the delegate class would be called by the OS itself. All that is needed for us to do is to implement the required methods, and/or the optional methods. Its really kinda amazing how things work.

I've been learning many new stuff since I came here as an intern on the first day. Everyday is about learning new stuff, not just technically, but about things going on in life as well.

Went for lunch with Kevin, Calvin, Bernard and Zac today. Talked about getting cars, houses and even a girlfriend. Interesting to know how they look at things in life. Had a tea break too, at level 14. It's like a common area for all the various different departments. Played pool with Kevin, Calvin, Gim Han and Zac. Man, they played like professionals!

Would be proceeding on to watch more lectures and complete more assignments tomorrow.

No comments:

Post a Comment