开发者

Objective C for iOS... a good resource for a php programmer?

I have been developing web apps (primarily) using php and a bit of python, mysql, etc for many years now. I have a reasonably good grasp of objective-based development, and use objects as much as possible in my projects, although I certainly don't take full advantage of them. I am comfortable enough to be dangerous with C++,C, and have even touched a bit on ruby.

All that said, Objective C is giving me a very hard time. Not sure if it's the syntax, the file structure, etc, but i'm just not grasping how to properly put together the different components of an app, despite having gone through a few tutorials and explanations online. I have xcode, and have tried doing some basic stuff, but get lost quickly in real implementation.

My question: Can anyone recommend me a really solid book/books with some good examples that I can walk through to help me understand this language better? I am primarily interes开发者_开发问答ted in database interaction (or xml parsing) and audio streaming/delivery capabilities.

Any suggestions would be very much appreciated! Thanks!


3 items:

The syntax isn't going to be a problem for long. Just keep reading Objective C code, and pretty soon the brackets will start seeming as familiar as the dots (or other forms of punctuation abuse) in other OO languages.

If you are a procedural language coder, you will have to get your head around event driven application design. The basic idea is you can't always tell the OS what to do, when you want to do it, and then do the next thing. You have to learn to chop up your procedural code into callbacks, and then let the OS call your code when the OS is good and ready. You might have to learn how to save appropriate state between callbacks (e.g. You can't use a "loop index" between callbacks without saving it somewhere.)

You might also have to get used to the object oriented MVC design pattern. It's like figuring out the difference between writing procedures for a one-man store, and setting up operations for a larger business with divisions in separate buildings. The guy talking to the customer isn't the guy closing the books. Same with MVC, the view presenting the UI to the user isn't necessarily the same object that does the storing or updating of the data representing what the user sees or does. Once you learn the logic of the separation, figuring out which file to look in for something will get a little easier.


I found Aaron Hillegass' book really helpful in learning Objective-C

iPhone Programming Big Nerd Ranch Guide

There are a bunch of good chapters that walk you through creating your own apps you can deploy right to your iPhone/iPad or run in the simulator. He explains some of the heavier concepts i.e. Core Data really well.

Other than that the Apple Developer docs are a great and invaluable resource.


I cannot recommend any books (I have learned it by doing a lot of experiments), but if you want to get started with Objective-C, I would recommend knowing what pointers are and how to use them. They form the most basic part of Objective-C and once you understand these (and NSObject), you understand 50% of the language itself.

You could, of course, read Apple's documentation at http://developer.apple.com/library/ios/#referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/


I would recommend:

iPhone Programming: The Big Nerd Ranch Guide

It is a very nice getting started guide for both Objective-C and iOS programming.


The official documentation is great: http://developer.apple.com/library/ios/#navigation/

This is a great book. You need to understand Objective-C before you start jumping into creating apps (Cocoa Touch): http://www.amazon.com/Programming-Objective-C-2-0-Developers-Library/dp/0321711394/ref=sr_1_2?s=books&ie=UTF8&qid=1296848502&sr=1-2

This is a great intermediate book: http://www.amazon.com/Cocoa-Design-Patterns-Erik-Buck/dp/0321535022/ref=sr_1_1?ie=UTF8&qid=1292262048&sr=8-1

This is a great forum to learn stuff, in addition, obviously, to here: http://www.iphonedevsdk.com/forum/

The Apple developer videos are also great, and you can download them with iTunes if you want, to have them on the go: http://developer.apple.com/videos/

Also, check out the Stanford iPhone Programming Class videos on iTunes.

EDIT:

Here is the docs on Apple's XML class, NSXML: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSXMLDocument_Class/Reference/Reference.html

And if you're going to be using databases, they'll probably be SQLite, and you'll definitely want to check out this wrapper for SQLite: https://github.com/ccgus/fmdb

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜