Wednesday, July 29, 2009

Day 2: Errors, Architecture and Syntax

Ah last night was eventful I did some more work on my application and I ran into a few issue some of which we're build errors that had to do with syntax. I'm still learning Objective-C syntax as I go, but what better way to learn than to fix your own errors.

One of the other issues that I ran into; which it really wasn't an issue it was more of an architectural decision more than anything. Being new to iPhone development I'm still trying to figure it out but I will persevere through it. I did get all of my build errors cleared up and actually I only had 3 errors and a couple of warnings. See the screenshot below:




I got up this morning before going to work and actually got on my computer and did some more coding on the application. I want to get in some work every moment I get so that I can finish by my deadline. One thing I'm trying to figure out is about the Views and ViewControllers. I was following this tutorial online by Nick Myers you can Watch the tutorial here and in the video he adds view controllers and views that are subclass of UIView. He mentions that you have to add the view controllers but you don't need to add any code to them.

On the other hand in the "Beginning iPhone Development" book they have view controllers and they add logic in the view controllers to handle the interactions of the view. My question is which method is the correct way or more efficient way of doing things? If anyone out there that reads this knows the answer or can point me in the right direction I'd appreciate it.

I'm really laying out the architecture and files for the application I haven't yet touched Interface Builder but one I get this architectural issue worked out I will begin building out the user interface for my application. Well until next time I will continue working on this application I have a lot of work to do ahead of me so I better get cracking.


Ngenious

2 comments:

  1. Understanding the Model-View-Controller (MVC) paradigm is absolutely critical to developing for iPhone (and Mac). In a nutshell: you should write your model so that it knows nothing about your view, and vice versa. Your controller should contain the only code that pertains to the way they interrelate. Sometimes there is such a simple interaction that you barely need any code, but you always need some. "Beginning iPhone Development" has the right approach.

    ReplyDelete
  2. Thanks Hamish after doing some more studying and looking again at the "Beginning iPhone Development" book I agree with your comment.

    ReplyDelete