Thank YOU!
Hi solderguy1,
Thank you so much for your reply.
I know stackoverflow.com, it's the because resource for php/jquery problems I have. I didn't know the 2nd website, but it was added to my bookmarks.
You're right about the job competition, I just will I'll be able to get into "the club";
Thanks a lot for your - + notes, now it's clearer to me!
Cheers,
Liroy
I learned by typing out notes, lots and lots of notes with short cookbook examples. Taking the time to write things out cleanly helps you learn it. And reading through the notes helps you retain them (pun intended).
I found the fastest way to code is to search my notes, then a Google search if needed.
http://stackoverflow.com/ is my favorite site for short code.
http://www.raywenderlich.com/ is my new favorite for tutorials
You already have the best book for beginners.
The good part about the difficult learning curve is that it reduces job competition and helps salaries once you're "in the club." Keep your chin up, and don't worry.
Here's my notes on the +/- methods as an example:
Code:
Instance Methods
Preceded with "-"
Declaring:
- (FMResultSet *)executeQuery:(NSString *)sql
withParameterDictionary:(NSDictionary *)arguments
Calling a method:
[yourCar getGas];
[self getGas];
currentMileage = [yourCar odometer];
[yourCar setSpeed: 55]; //calling with argument
Multiple arguments get interleaved with names
[myFraction setTo: 1 over: 3];
-(void) setTo: (int) n over: (int) d
{
numerator = n;
denominator = d;
}
Can omit argument names, but not recommended
[aFraction set: 1 : 3];
-(int) set: (int) n: (int) d;
Example:
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
Class Methods
Preceded with "+"
Obj-C's version of a Static method that is per class and not per instance, only one around.
Benefits
1. Can produce results without having to instantiate an object
Good for convenience (debug) methods
Another approach is a simple C function declared in header files
2. Can be used to pull a singleton's reference from anywhere
Many singletons in IOS
3. Ties into the IOS memory management scheme
[NSArray array] class method that returns autoreleased initialized array
----------
It sounds like you're having problems with the concepts of object-oriented programming as well as being overwhelmed with the richness and complexity of the Cocoa Touch frameworks.
iOS is a big, complex OS. There's a lot to learn. Don't be discouraged, though. After struggling with it for a while it will start to make sense.
Hi Duncan
I know oop well, it's the syntax that is hard for me. I'm used to dots and -> in php, not [ ] etc.
The Cocoa Touch frameworks is quite difficult, and yes, I am highly overwhelmed with all the options and functions. I get lost in it...
Thank you for your encouragement! I will try harder to learn it. I've put a task for myself to finish one chapter per day in the book.
Thanks again!
----------
First off, I doubt it's Xcode you're finding difficult. Xcode is an IDE. The things you've described weren't difficulties with its features, like the interface builder or debugger tools, but with the Obj-C language and Cocoa Touch Frameworks.
solderguy1 already gave a good explanation of the +/- that prefix methods.
I'd like to mention that you should probably have a goal in mind other than "learning" Cocoa Touch. You're going to be overwhelmed. I'd say focus on specific goals instead. Think of something you'd like to do in your app, and then figure out which classes and methods will help you do it. IDK, that's the way I learn at this point.
Maybe you should look at the iOS development classes offered by Stanford for free via iTunes U. They'll give you a great introduction to some of the essential classes and methods of the Cocoa Touch frameworks.
You're right, Xcode is easy. It's the Obj C and the Cocoa Touch frameworks I find hard to manage. I saw the Stanford classes in the iTunes U, is it really a recorded webcast that you can learn from?
Thanks again for your comment, it encourages me to keep struggling.
----------
You mentioned that you know PHP. I started PHP a few months ago and noticed that you could write in this language 2 ways. Procedurally like in C, or object oriented. I am guessing that you use PHP procedurally like I am using it.
I have the Big Nerd Ranch Guide but If I would have learned from this book I would have failed. Learning Objective C and Cocoa at the same time would have been over kill for my brain.
I started with Stephen Kochan Programming in Objective C which was a struggle too. I ended up buying the videos to better help illustrate what was going on. As a side note this was my first programming book and I failed. I stepped back to learn C and only then was I able to step back into this Object C book.
PHP is like speaking English for me, I see the logic and the concept in it, and I just swim in it - but obj c is the opposite. Every time I think I understand what's going on, I see a new method or a new framework, and I have no idea what I'm doing...
I would see the podcasts in the iTunes U of Stanford, hopefully it will help me to illustrate what's going on.
But yeah, I felt like my brain is being overkilled...
----------
Go thru the Stanford podcasts. They are very good. We make them a requirement for all new hires.
Do the exercises. Don't just read them...
Will do. I had no clue about the iTunes U app and the Stanford podcasts... Thanks!