Tuesday, October 12, 2010

12 October 2010

Continued with assignments 2A and 2B today. Managed to do them without much problems. Probably because we have done the other assignment of the Fall (2010) edition where we created the calculator. Getting used to the syntax in Objective-C already. Many thanks to Kevin who spent time going through with us what we have done and helping us brush up on our concepts.

Finished going through lecture 5 as well as trying out the sample codes in the lecture slides. Had quite a few problems trying to get the program working though. At first, we had no idea as to where to place the sample codes. I tried putting them in the delegate class, but nothing happens. After some clarifications with Kevin, we were told not to touch anything in the delegate class for now.

Hence, we moved on to create a new View Project. In this project, implemented the drawRect method. I supposed that it would work already, however, that wasn't the case. After some researching on the net, I realized that the drawRect method belongs to the UIView class. Since our ViewController class inherits from the UIViewController class, the drawRect method doesn't work.

After modifying the class to inherit from UIView, I thought that it would work. However, that again wasn't the case. After researching, I realized that the initWithFrame method has to be implemented as well. From there, we managed to get our programs working. Finally! We spent like... 2 hours? Oh man. It's kinda tough to think clearly with fever, flu, cough and sore throat around :( get well soon alex! -.-

Some references that I used:
http://www.questionhub.com/StackOverflow/2811427

Time now is 6.20 pm, time to pack up and get some rest at home!

No comments:

Post a Comment