Cocoa Addiction

Sunday, April 22, 2007

Waking from Nib

Yes I'm fully aware of the fact that its been almost two years since any of us posted anything on this blog. Thing is our Objective-C Classes only lasted long enough to generate those six posts. I don't remember exactly why we cancelled our 'classes' (probably because all three of us moved to different cities) but it was fun while it lasted.

A lot of php, Java and a Dashboard widget later - things have changed a lot since then. Also, I now have a Mac which obviously makes learning a lot easier than going to K's house every time I wanted to execute any Objective-C code! Anyway, the reason I'm bothering to post after so long is that I have, for what I believe is the third time now, started learning 'Mac OS X Programming'. This time however, I'm determined to at the very least, complete the book that I've selected - 'Beginning Mac OS X Programming' (ha!) by Michael Trent and Drew McCormack.

So far, I've been going at the rate of a chapter a day but that's probably because they were mostly introductory chapters which I more or less knew anyways. I hope to document some rants, ooohs and aahs on this blog while I switch between revising the Harry Potter books (to prepare for HP and the Deathly Hallows ofcourse!) and learning Objective-C.

-P

P.S. - It just struck me that a Harry Potter book was due when we'd started two years back too!

Wednesday, July 20, 2005

Xun 0.1

This is a project update for Xun - the registration software outlined earlier.

Where have we reached? Well, practically speaking, nowhere. But, since this the first software we're making - N, P and K - we have done a great deal of stuff.

We know how to apply Bindings now, finally, even if we don't understand everything about them clearly. We are also very used to the Connections that are used in Interface Builder - once you get to know them, they seem more and more like magic. So much of the "glue code" that you'd have to write simply vanishes by using Connections and Bindings. In fact, in the example project that we did, we managed to get rid of about three hundred lines of code by using Bindings. So, the verdict is in - Bindings are a good thing.

So, did we finally find a good site for tutorials? Yes, we did!
Check it out! It's a lovely site. Not only is the design elegant and easy on the eyes, the tutorials are really really well done. Five Stars for CocoaDevCentral.COM.

In any case, the project report, yes...
  1. Xun can now accept a list of schools from the user and assign a list of students to each school
  2. Xun uses Cocoa Bindings
  3. Xun uses a Drawer!
  4. Xun saves all information to a file when exiting and restores it from the file at startup - all automatic!
--K

Tuesday, July 12, 2005

From C++ to Objective-C

Them that developed those two had the same goal - to create an Object Oriented Language using most of the features of 'C', if not using it as a base itself. Now the problem is, both were inspired by two different languages, C++ from 'Simula 67' and Objective-C from Smalltalk. As we're using "the Mac OS X Objective-C application development framework—Cocoa", it only makes sense for us to learn the language first. That canot be avoided, but the one thing the OCCMA* likes best is the amount they get to critisize it. Actually its more the tutorial thats to blame, not the language. There have been times when after reading a topic, all we conclude is that plumbing is very important to buildings. Jokes apart, Objective-C does seem to be quite a nice language now that we're begginning to understand more and more of it. Its a lot more dynamic than C++ and has wonderful features like representing a Class as an object of the Class class. Yes, that does make sense and is helpful.
Though reading C++ code might seem comparatively easy to us today, thankfully Objective-C code is much more easier to read due to the use of complete words with an 'NS' prefix here and there. The transition is happening, and hopefully the OCCMA will soon outperform what C++ limited them from.

*Objective-C Class Member Association. Official tagline - "Awake from Nib".

--P

Sunday, July 10, 2005

maild

Project name: Mail Daemon

Purpose: Without requiring Mail.app to be running, this daemon periodically checks all the incoming mail servers configured in Mail for new mail and notifies the user.

--K

Friday, July 08, 2005

The n-factor

You just knew it would happen did you not? The K and the P?? That is just inherently wrong, there is so obviously an N missing. The basic purpose of this post then is not to tell you this, however, it is to outline the purposes and ultimate goals of The Addiction.

They are as follows :-

* To create an application that performs required tasks when Mac OS X starts up, or shuts down.
* To create, as a parting gift to our beloved ExUn, a registration/organisation software for the annual symposium. The software, if possible should do the following:
      • In a three (or more) window system, it should accept the name of all the participants from the school, the names of all events and who is taking part in them, and also the names of all the winners, in each event.
      • The program should allow for drag and drop facility to add names in events, and a drop down menu of all applicant's names when assigning a winner.
      • The program should allow the user to publish, on the internet, the names of the winners.
      • It should also check the type of data entered and report errors and inconsistancies.
--N

Thursday, July 07, 2005

The Beginning

The hardest part of starting anything is the beginning. Having a guide to carry the lantern makes it a whole lot easier to follow the path, and this is the reason why people want to go to NIIT instead of learning things themselves. After all, there is probably more knowledge today on the Internet than any other public repository. You can learn Java, PHP, C++, C and anything else you like - for free, over the net. You can also learn a lot of other stuff that has nothing to do with computers whatsoever. But knowledge on the Internet is not always necessarily organized, easy to follow, written in an easily readable style or format and a lot of the times it can be downright distressing. But there's a joy in self-discovery, in trial and error and finally, in finding the Light that isn't there when somebody is leading you along a fixed path.

So, how does one make a beginning in Cocoa development for Mac OS X?

That's the question that dwelt in the minds of P and K, the two young programmers that are. The obvious place to search first was Apple's website, Apple being the chief agent in all Cocoa affairs, having invented the environment. And P and K were lucky. They found a tutorial called Currency Converter which not only explains all the necessary concepts of object-oriented programming, but also states the advantages of Objective-C over other languages like C++ and teaches how to use Apple's IDE "Xcode". The only snag in this perfect website can be that it rather likes to use complicated language sometimes, which takes more than a glance to understand.
In addition to the tutorial, there's also a guide to learning the Objective-C language, which explains also the concepts of object-oriented programming in addition to the syntax.
These are the best resources that P & K have found on Apple.com. Sometimes hard to follow, often making the brain do a lot of thinking, but always informative and dead accurate, these resources help you learn the language and the development environment.

--K

A Tale of Two Programmers

Once upon a time, in a land far, far away, there were two programmers. They were called K and P. One day, they decided that they wanted to learn. So, off they went into the outside world, amidst torrents of rain and the howling wind, into a new world where dangers lurked around every corner. They went to the place then known as NIIT, and when they told the capitalist, over-charging and mind-controlling (yet knowledgeable) people at NIIT that all they wanted to do was learn, they laughed at them. They laughed a cruel, sarcastic laugh and banished them with the figure of eleven thousand big ones for a three-month course in the evil Microsoft's dark arts, then known as ".Net". K and P shunned the darkness; they were in pursuit of real knowledge. They sought the Light. This is their tale.