Python to Objective-C: Initial Reactions

Here are some of my initial thoughts and reactions coming from a scripting (Python) background on Objective-C and iOS:

  • Overwhelming API documentation. To me this is just a case of hunkering down and mugging like a good A level student.
  • Obsolete Stackoverflow answers. With every yearly release of a new iOS version, it kinda makes an entire generation of SO answers redundant. The game changes very quickly
  • There’s quite a fair bit of plugins out there in the wild. Initially, I was rolling my own image downloader and caching mechanism only to find quite a few libraries out there doing exactly that (and better) already

Some lingering questions still on my mind which I hope to be cleared up as I go along:

  1. In a segue, when to use push and when to use modal
  2. Modification of UI elements in the storyboard or in the code
  3. Passing on values from one view controller to another. Direct assignment in the prepareForSegue method or what?
  4. How do I quickly check in XCode what methods are needed to be implemented for a new delegate or data source
  5. The difference between @class and #import
  6. strong/weak references in declaration of properties
  7. Project and folder layout hierarchy
  8. Paths and inclusion of new files

Updated with answers!

  1. The way I think about when to use push or modal segues is to use a RPG example: if you’re exploring a dungeon and you go into a room, if the room leads to more rooms, use a push segue. If the room is a dead end, use a modal segue.
  2. Where possible, reduce code bloat and use storyboard modifications. This is kind of subjective
  3. Direct assignment is fine. I think I was being overly paranoid with this question
  4. cmd + click is your friend. Then look for @required methods. This should get better with experience
  5. General rule of thumb: if you need to alloc/init something, you have to import it. @class is almost always used only in header files
  6. When in doubt, use strong
  7. I’m actually still figuring this one out
  8. If you click on a file and goto the file inspector, you can see a Location drop down that allows you to set the path. The thing that threw me off initially was that your project path directory need not match your Explorer folder path directory.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s