views:

97

answers:

2

Hi everyone,

For my job, I've been writing an iPad application that the user can enter data into, view some pictures, etc. It's been annoying me that I'm reaaaallly slow at writing in Obj-C and I find myself bogged down in the UI (an example would be I always have to put in a UITableView which is time consuming...) I think that I have a pretty good handle on the language and Apple SDK.

Does anyone have any tips regarding how to speed up the development process from a UI perspective? Are there alternative tools to xCode and IB? Are there libraries with classes that are faster to program w/? Anything is appreciated,

mj

+2  A: 

Avoid UITableViewController if you aren't already.

For speeding up TableView dev, I always keep a pretty generic implementation of TableView handy that I can copy and paste snippets from.

If you are constantly doing TableViews for different object types, try using Protocols to make the implementations more uniform.

Don't be afraid of UIViews as subviews as opposed to constantly using UIViewControllers. Sometimes a VC is just an extra layer of complexity that you don't need.

My experience is that the biggest thing you can do as an iPhone developer to become more efficient is to know when and when not to use Controllers as opposed to Views when doing complex interfaces.

Wish I could be more specific but your question is a little vague... there's nothing wrong with Interface Builder, it's just a steep learning curve.

Jasconius
+5  A: 

Interface Builder can already speed up your development considerably if you learn to use it. For example, see this custom table cell with IB tutorial.

For example, at my current employer I've seen a Cocoa Mac OS X app where the settings dialog was done completely in IB... there was no code for modifying or sync'ing the values in the NSUserDefaults with the interface elements, everything was done in IB.

Also, see this interesting article: Striking the Balance: Interface Builder vs. Code.

DarkDust
Agree 10000%. The worst thing you can do is quit on Interface Builder. I've seen apps with entire interfaces written in code. Total waste of time, very hard to read, harder to edit.
Jasconius
Here's a semi-related question. As I'm implementing my UIs, I run into type-safety issues. An example that just happened to me 5 min ago is that I had an NSMutableArray that I used to store objects of type X. I accidentally put in a type Y. Naturally at run-time, I crashed because I tried to make a function call on an object that the obj didn't support. Are there tricks I can utilize in order to make my code more safe?
mj_
Sorry, don't have any except for "be careful" :-) Or maybe when you pull something out of the array, check with the `respondsToSelector:` whether the method you want to call really does exist on the object. Maybe ask an experienced Java or .NET developer, before they had generics they faced the same issue.
DarkDust