iPhone/Obj-C development complicated??
I've been using Java for ~5 years now (I am currently a third-year undergrad), and in the last year of school, my classes have introduced me to C and C++. I haven't had too hard of a time with those new concepts introduced in C, however I downloaded the iPhone SDK and I am completely overwhelmed. The syntax is confusing, there are both [sender method] type messages along with standard sender.method() functions... I went through quite a bit of Apple's documentation before I had a meltdown.
Now, did I give up too early? How am I supposed to grasp all of this new information, especially when Apple's documentation seems extremely hard to follow..
Now, did I give up too early? How am I supposed to grasp all of this new information, especially when Apple's documentation seems extremely hard to follow..
Objective-C is odd at first, but if you're experienced in Java, it shouldn't be hard to grasp at all. Still, I'd say the way to go would definitely be getting a copy of Cocoa Programming for Mac OS X, by Aaron Hillegass. Arguably the best introductory Cocoa/Objective-C book out there, and definitely one of the most popular. Plus, if I recall correctly, there are a few places in the book where Hillegass actually says things like, "In Java, you're used to doing it like this, but in Objective-C, this is how we do it."
I may not be an iPhone developer myself, but from what I understand, Cocoa/OS X development and iPhone development overlap quite a bit, so I'd say you'd be better off learning Cocoa in general before moving onto the iPhone.
For other suggestions, see this thread. And I'm sure there are many other threads like that -- search the forums a bit if you want more suggestions.
I may not be an iPhone developer myself, but from what I understand, Cocoa/OS X development and iPhone development overlap quite a bit, so I'd say you'd be better off learning Cocoa in general before moving onto the iPhone.
For other suggestions, see this thread. And I'm sure there are many other threads like that -- search the forums a bit if you want more suggestions.
Since when was "Fred" a placeholder variable?
You probably learned java a little bit at a time. Your first projects were pretty small, probably 10 lines or less all in your main method. It sucks going back to it, but I think that's what you have to do when you are learning a new language. Don't worry, it does go a lot quicker, but you still have to start at the beginning.
I've tried to jump into languages from basically nothing but reading a lot about the language, and that's not worked too well for me. Sit down and make simple things, and step it up until you get to where you want to be.
I've tried to jump into languages from basically nothing but reading a lot about the language, and that's not worked too well for me. Sit down and make simple things, and step it up until you get to where you want to be.
Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
It may not be the best idea to jump right into the iPhone waters, you might want to do some Mac stuff first.
Even with 5 years of Mac experience I still had a bit of a learning curve going to the iPhone.
Even with 5 years of Mac experience I still had a bit of a learning curve going to the iPhone.
I wouldn't mind learning Cocoa anyway, seeing as I work on my Macbook Pro and it would be nice to develop applications for it.. Thanks for the advice!
The dot syntax is going to be confusing for anyone new to the language. It's a special bit of syntactic sugar that Apple added that makes your code a little less noisy, but is functionally absolutely no different than the old way.
Previously you had setter/getter methods like so:
And you had to call them like so:
In simple code, that's fine and easy enough to read, but something like:
It starts to get a little "messy". So Apple came up with this "Property" dot-syntax. It's not to be used for calling generic methods, it's only supposed to be used for setter/getters.
With the new syntax you define the property:
And can use it:
The ugly code above would be slightly more readable:
If you see "objectInstance.something = x" that simply is a shortcut for "[objectInstance setSomething:x]".
If you see "x = objectInstance.something" that simply is a shortcut for "x = [objectInstance something]".
Previously you had setter/getter methods like so:
Code:
- (void)setSomething:(id)thing;
- (id)something;And you had to call them like so:
Code:
id thing = [obj something];
[obj setSomething:thing];In simple code, that's fine and easy enough to read, but something like:
Code:
if ([[[self selectedMovie] audioCompressor] bitRateString]) {
audioSettings = [audioSettings stringByAppendingFormat:@", %@",
[[[self selectedMovie] audioCompressor] bitRateString]];
}It starts to get a little "messy". So Apple came up with this "Property" dot-syntax. It's not to be used for calling generic methods, it's only supposed to be used for setter/getters.
With the new syntax you define the property:
Code:
@property (readwrite, retain) id something;And can use it:
Code:
id thing = obj.thing;
obj.thing = thing;The ugly code above would be slightly more readable:
Code:
if (self.selectedMovie.audioCompressor.bitRateString) {
audioSettings = [audioSettings stringByAppendingFormat:@", %@",
self.selectedMovie.audioCompressor.bitRateString];
}If you see "objectInstance.something = x" that simply is a shortcut for "[objectInstance setSomething:x]".
If you see "x = objectInstance.something" that simply is a shortcut for "x = [objectInstance something]".
Don't forget to read The Objective-C 2.0 Programming Language first to see if you get it. Its free.
Also check out http://www.cocoadevcentral.com for some slightly outdated tutorials.
Also check out http://www.cocoadevcentral.com for some slightly outdated tutorials.
If you know C, and you're looking to make a game that draws entirely with OpenGL ES then you don't need to go too nuts learning Obj-C/Cocoa. You can also basically ignore Interface Builder...
I knew next to no Cocoa when I started prototyping my first iPhone games. I read Apple's Obj-C programming guide, the iPhone programming guide, and a few of the Cocoa primers/tutorials available online (be sure to read up on memory management). Those docs provide all the info needed to wrap the required Cocoa Touch APIs into functions exposed by plain C headers. The actual game implementation can then be written in C/C++.
I knew next to no Cocoa when I started prototyping my first iPhone games. I read Apple's Obj-C programming guide, the iPhone programming guide, and a few of the Cocoa primers/tutorials available online (be sure to read up on memory management). Those docs provide all the info needed to wrap the required Cocoa Touch APIs into functions exposed by plain C headers. The actual game implementation can then be written in C/C++.
I've been donig Java for around 10 years and picked up ObjectC pretty quickly. Its not as pretty as Java, but its not too hard to get your head around.
I found this very useful
I found this very useful
it's not complicated at all, I used Aaron Hillegass's book to learn Obj C/Cocoa Development and it was the best book i've read about Cocoa development.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Win a copy of: Beginning iPhone 4 Development: Exploring the iOS SDK | @iOS_blog | 0 | 2,692 |
Oct 1, 2011 04:23 AM Last Post: @iOS_blog |
|
| iphone 4 game development | andynov123 | 2 | 6,272 |
Jan 18, 2011 01:27 AM Last Post: JohnEdward |
|
| Beginning Iphone game development collision | lunayo | 0 | 3,183 |
Oct 8, 2010 11:43 AM Last Post: lunayo |
|
| Problem with making a game with the iPhone Game Development book | MrPenguin9 | 2 | 4,373 |
Feb 1, 2010 09:13 AM Last Post: MrPenguin9 |
|
| Does anyone know good course in iphone app development? | Irina | 5 | 4,545 |
Jan 16, 2010 11:52 AM Last Post: kgutteridge |
|

