My Xcode Experience – Day 3 – where square brackets aren’t just normal brackets

I have been busily attending xcoding classes and programming faithfully every night for 2 hours this past week.

Session 2!

Session 2!

This Wednesday, we had Daniel, Steve and Kong (of course) explaining many basic concepts that most programmers probably take for granted, such as ‘variable’, ‘class’, ‘subclass’. We also had some programming exercises to explain operators and concepts like loops (i.e. if, else). We also ran through some of our tutorial questions although some bits got a little bit intense for beginners! 😛

Quite pleased with my progress (a bit slow la…haha) so far and the stuff I’ve been learning! I seriously can’t believe that I’m actually writing simple pieces of code and solving little puzzles (okay to me, I do a dance each time I complete them because it’s one big step forward hehe)!

I learnt about tables and how to customize them. I was pretty excited when I learnt about indexPath too!

For example, look at:
[tableData objectAtIndex:indexPath.row]

So objectAtIndex:indexPath.row means (in Ning’s half-machine, half-layman language) that we are getting an object at a specific row by accessing the Index at indexPath.row.

One of our coaches, Daniel,  expertly explained to me,

‘the square brackets are the syntax for “sending a message” to an object. Essentially this tells an object to perform a method.

In this case, you are saying

tableData (an Array Object), get me the objectAtIndex (method) indexPath.row (the method’s argument variable)

where indexPath.row is an integer.’

Yes, even the  square brackets mean something!

Summarising what I’ve learnt:
1. There is seriously a temptation to cut-and-paste tutorial code, but you have to type it out! If you have someone look at the code and ask you questions, it really makes you think!
2. When tutorials don’t tell you everything, you learn faster, and feel accomplished too! I realised that the tutorial has started to ask some questions that you need to figure out to proceed. So you’re not just a copy-and-paste machine, you have to think to solve them.
3. Found also a very helpful tool in Xcode called quick help, it’s like a mini version of the documentation, I find that clicking on it as I write code helps me learn.
4. Never stop asking too! I am super grateful that the coaches are super responsive (does everyone sleep late like me? Is this a coder thing? does that mean I have a chance to be a coder?) and it feels so much better knowing there’s people around to help out! YAY!

Okay, time to call it a day! TGIF – to more coding!

Find out about the 30 day Challenge here.

Resources referred to in this entry:
Appcoda: http://www.appcoda.com/ios-programming-course/ I am learning from their tutorials.
iOS Developer Library: http://developer.apple.com/library/ios/navigation/ Documentation, documentation, documentation
Xcode: https://developer.apple.com/xcode/ Where all the coding magic happens!

Author: ning

Leave a Reply

Your email address will not be published. Required fields are marked *