I’m working my way finally through the Hillegass Cocoa book – but of course my 2nd Edition arrived 4 months ago and I never had the chance to read it and 3rd Edition is out and covers the new XCode so I’m going to be fighting an uphill struggle. I’ll order 3rd Edition after payday.
I find code to be hard. My schedule doesn’t allow for me to be consistent in my approach to learning and so I find myself flailing back and forth, trying to remember the stuff I wrote last time round and spending half my allotted time re-learning. It doesn’t stick much. I’m now convinced I need a mentor to do this who will work through the examples with me, advise me left and right and not get all het up when I’ve had a crap week and didn’t get the chance to sit down and work through examples.
My first problem comes with expectations. If I’m control-dragging connections to the left and right in Interface Builder, I was expecting some code to be generated. Instead I have to manually add these things.
My second problem comes with pre-generated code. It added in an import for UIKit/UIKit.h for some reason – and then when I hit Compile, it burped and complained about UIKit. Claimed it couldn’t find it. To which I say “Well, don’t frigging look at me, you put it in there????” This sort of thing frustrates me -especially when I realise it compiles fine when I change that to Cocoa/Cocoa.h.
This error has nothing to do with using the 2nd Edition book. It’s a subclass of NSObject which comes with the UIKit.h reference which XCode subsequently has a kitten about. That’s just stupid. So either there’s something wrong with my XCode (entirely possible) or I’m just the worst coder in the world.
I’d say it’s even odds.
[And the result is in. I’m the worst programmer in the world. I’d added a Cocoa Touch NSObject subclass to my Mac application. Cocoa Touch has UIKit.h. Cocoa has Cocoa.h. I feel stupid now but I have to chalk it up to some sort of learning experience.]