Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 16, 2009, 01:18 PM   #1
RNDesigns
macrumors newbie
 
Join Date: May 2009
Location: USA
Learning syntax basics for Objective C - Frustrated beginner

Hi all,

I'm new to this forum so I'll also use this post as an introduction.

I want to learn to program badly and I'm not having much luck at all. I've been trying to teach myself for years with very limited success. My first attempt was with RealBasic and I managed to do a few things with it.

I've been a Mac user for years (since about 1991) and have recently discovered XTools and have have trying to learn it along with Objective C and Cocoa.

Over the past couple months I've visited dozens of websites, read a lot of documentation and worked my way through many tutorials. No matter where I go, what I read or what I accomplish it seems like everything starts out in the middle and there is no really good place to get a basic understanding of programming.

For example, every thing that is a starting point for learning Objective C says you need a thorough understanding of C. I found what I thought was a good site for learning C and started working through it and learned a good deal, but in the end it really didn't help me. in understanding Objective C.

I am currently reading the "The Objective C Programming Language" at the Apple Developer website. (The 1.0 version because I don't have Leopard yet)

My problem seems to be not being able to get a handle on syntax. I can't seem to find a comprehensive document that gives the methods for objects. It seems everything I read assumes you know something else that I don't. Case in point: I tried to make a screensaver. I had success in making one from a tutorial but all I really did was copy code. When I tried to adapt it to my own needs it all blew up. The tutorial used rectangles an I wanted to make a simple line. I thought NSBezier path was what I needed to use but nothing I tried would make a line.

I don't want to ramble on and on. Maybe this will give someone here a key to help me know what to do from here. I'm not a stupid person; I know I can get this if I can just find someone to help a non-programmer from the beginning.

Thanks for reading.
RNDesigns is offline   0 Reply With Quote
Old May 16, 2009, 01:21 PM   #2
cube
macrumors G3
 
Join Date: May 2004
Stop with hat C baggage and start here:

http://htdp.org/2003-09-26/
cube is offline   0 Reply With Quote
Old May 16, 2009, 01:24 PM   #3
t0mat0
macrumors 601
 
t0mat0's Avatar
 
Join Date: Aug 2006
Location: Home
Quote:
Originally Posted by cube View Post
Stop with hat C baggage and start here:

http://htdp.org/2003-09-26/
Is there a pdf version?
__________________
Whither Skylake?
t0mat0 is offline   0 Reply With Quote
Old May 16, 2009, 01:24 PM   #4
mathcolo
macrumors 6502a
 
mathcolo's Avatar
 
Join Date: Sep 2008
Location: Colorado
Try this AMAZING online PDF book:

http://www.cocoalab.com/BecomeAnXcoder.pdf
__________________
13" MacBook Pro Retina - 2.6 GHz i5 - 512GB SSD - 8GB RAM
- Google Nexus 5
[Retired]13" MacBook Pro - 2.53 GHz C2D - 240GB SSD - 8GB RAM
[Retired]- Samsung Galaxy Nexus LTE
mathcolo is offline   0 Reply With Quote
Old May 16, 2009, 01:30 PM   #5
GorillaPaws
macrumors 6502a
 
GorillaPaws's Avatar
 
Join Date: Oct 2003
Location: Richmond, VA
Get the Kochan book: "Programming in Objective-C 2.0: 2nd edition". It's really well written, and will give you the foundation you're going to need to move on to Cocoa.
GorillaPaws is offline   0 Reply With Quote
Old May 16, 2009, 01:33 PM   #6
cube
macrumors G3
 
Join Date: May 2004
Quote:
Originally Posted by t0mat0 View Post
Is there a pdf version?
I don't know if there's a legal PDF version.

I would just buy the print:

http://www.amazon.com/How-Design-Pro...dp/0262062186/
cube is offline   0 Reply With Quote
Old May 16, 2009, 02:42 PM   #7
RNDesigns
Thread Starter
macrumors newbie
 
Join Date: May 2009
Location: USA
Quote:
Originally Posted by cube View Post
Stop with hat C baggage and start here:

http://htdp.org/2003-09-26/
I got this far:

To focus our studies on the important concepts of computing and not on these details, the teaching languages of DrScheme deal as much as possible with numbers as precise numbers. When we write 1.25, DrScheme interprets this number as a precise fraction, not as an inexact number. When DrScheme's Interactions window displays a number such as 1.25 or 22/7, it is the result of a computation with precise rationals and fractions. Only numbers prefixed by #i are inexact representations.

Exercise 2.1.1.

Find out whether DrScheme has operations for squaring a number; for computing the sine of an angle; and for determining the maximum of two numbers. Solution

Exercise 2.1.2. Evaluate (sqrt 4), (sqrt 2), and (sqrt -1) in DrScheme. Then, find out whether DrScheme knows an operation for determining the tangent of an angle. Solution

Quote:
Originally Posted by GorillaPaws View Post
Get the Kochan book: "Programming in Objective-C 2.0: 2nd edition". It's really well written, and will give you the foundation you're going to need to move on to Cocoa.
I don't want to buy any books.

Last edited by kainjow; May 16, 2009 at 05:54 PM. Reason: merged consecutive posts
RNDesigns is offline   0 Reply With Quote
Old May 16, 2009, 06:12 PM   #8
eddietr
macrumors 6502a
 
Join Date: Oct 2006
Location: Virginia
Quote:
Originally Posted by RNDesigns View Post
I don't want to buy any books.
Then, unfortunately you're starting at a pretty big disadvantage and you've answered your own question about why you're struggling with this.

I don't buy books very often anymore either. But that's after 25 years of programming. At that point reference docs are more than enough.

But if you're just starting out and you can't take a class or two to help you get started, then at least consider buying a couple of books. Yes, it is possible to learn without books. It's also possible to walk from NY to Boston. But why would you want to?
eddietr is offline   0 Reply With Quote
Old May 16, 2009, 06:30 PM   #9
RNDesigns
Thread Starter
macrumors newbie
 
Join Date: May 2009
Location: USA
Quote:
Originally Posted by eddietr View Post
Then, unfortunately you're starting at a pretty big disadvantage and you've answered your own question about why you're struggling with this.

I don't buy books very often anymore either. But that's after 25 years of programming. At that point reference docs are more than enough.

But if you're just starting out and you can't take a class or two to help you get started, then at least consider buying a couple of books. Yes, it is possible to learn without books. It's also possible to walk from NY to Boston. But why would you want to?
Maybe you're right and maybe, after all is said and done I'll have to shell out 50 bucks or however much to learn this.

On the other hand, I'm kinda worried about doing so. The internet is a wonderful place to learn lots of stuff. What if a book doesn't get me any further than what I've gotten off the internet? Then I'm at the same place as now and a few dollars shorter.
I'm telling you, I've done a lot of searches for a lot of things and so far I've been able to learn everything I've needed to know on every subject except this and one other for free.

In other words, I find it hard to believe that the only usable knowledge about programming can be learned from purchasing a book.

WADR,
Rick
RNDesigns is offline   0 Reply With Quote
Old May 16, 2009, 06:43 PM   #10
RNDesigns
Thread Starter
macrumors newbie
 
Join Date: May 2009
Location: USA
I don't mean to sound like a tight-as y'all.

I guess the main thing is that all I want to do is stuff for myself. I don't want to develop games for sale or anything like that. If that was my goal I'd be more than willing to buy a book or any other tools to get the job done but to be honest I just want to do this to learn something new and maybe if the opportunity presented itself I could give back something.
RNDesigns is offline   0 Reply With Quote
Old May 16, 2009, 08:30 PM   #11
GorillaPaws
macrumors 6502a
 
GorillaPaws's Avatar
 
Join Date: Oct 2003
Location: Richmond, VA
Kochan's book is around 600 pages long (and it doesn't even cover the app kit stuff). There is a LOT of basic theory to understand before you can do much of anything. Some of the theory is basic programming concepts and logic, and the rest is specific to objective-c--all of it is pretty essential.

It's true that there is a ton of freely available information out there on the web, but usually it comes in bite-sized chunks. The reason for this is that many people are willing to volunteer their time and expertise to helping share knowledge with others in small bits. However, very few are willing to put together a massive and comprehensive project on the scale of teaching a beginner to programming most of what he needs to know to be a competent Cocoa programmer. The time/energy/resources required to produce something on this scale really dictate that it be released in a published form.

To use an analogy, I can certainly look up most any legal principle or significant court ruling on the web, but there really aren't any free resources out there that would give me the knowledge necessary for passing the bar. I can personally attest that Kochan's book really helpped me personally, and it's only 30 bucks. It's not really that big of an expense in the big picture, and if you somehow manage to read the whole thing and not find it valuable, you can always re-sell it. You could always try your library (I donated my 1st edition copy to my local library so maybe someone near you did the same).
GorillaPaws is offline   0 Reply With Quote
Old May 16, 2009, 11:36 PM   #12
chrono1081
macrumors 604
 
chrono1081's Avatar
 
Join Date: Jan 2008
Location: Isla Nublar
Quote:
Originally Posted by RNDesigns View Post
I don't want to buy any books.


Books are really the only way to learn programming in depth. As another poster mentioned you will find bits and pieces online, but you get what you pay for and online is free.

I've never used the Kochan book but I know I will be ordering it. Coming from C++ I can work my way through some online tutorials but I know they are lacking a lot.

If you will be learning programming you will end up buying books. LOTS of books. Even once you finish them you will always be looking back to them for references.
__________________
Mac Pro (2010): 3.33Ghz Intel Xeon (6 core) - 24 GB RAM - NVidia Quadro k5000
Macbook Air (2010): 2.13 Ghz Intel Core 2 Duo - 4GB RAM
chrono1081 is offline   0 Reply With Quote
Old May 17, 2009, 12:52 AM   #13
RNDesigns
Thread Starter
macrumors newbie
 
Join Date: May 2009
Location: USA
Thanks y'all.
RNDesigns is offline   0 Reply With Quote
Old May 17, 2009, 01:53 AM   #14
t0mat0
macrumors 601
 
t0mat0's Avatar
 
Join Date: Aug 2006
Location: Home
One way is to have the book next to you on a benchtop as you work on playing with code on your desktop/laptop. You can dip in whenever, and follow the book, or find things in the book as you hack the code. Check your mail.
__________________
Whither Skylake?
t0mat0 is offline   0 Reply With Quote
Old May 17, 2009, 08:54 AM   #15
RNDesigns
Thread Starter
macrumors newbie
 
Join Date: May 2009
Location: USA
Quote:
Originally Posted by t0mat0 View Post
One way is to have the book next to you on a benchtop as you work on playing with code on your desktop/laptop. You can dip in whenever, and follow the book, or find things in the book as you hack the code. Check your mail.
I checked my mail. I need a way to get in touch with you.
RNDesigns is offline   0 Reply With Quote
Old May 17, 2009, 12:30 PM   #16
HyperSnake
macrumors member
 
Join Date: Jan 2009
Location: Switzerland
The web is a great place, but you never find big tutorials there, believe me I tried it when I was in your situation just 3 months ago. After a night of research I found out I would need a book. Kochan's book tought me everything and guess what? I'm currently finishing my second iPhone app. To say you want to learn programming but not buy a book is like saying "I wanna learn how to read and write but I don't wanna go to school". When you have learned how to program( or as in the example, write ), sure
All the help you'll need is online but the for
the basics, you'll need a book(or as in the example, go to school.)

PS. Unless you're really stupid, I can tell you that programming is not difficult to learn.
HyperSnake is offline   0 Reply With Quote
Old May 17, 2009, 03:25 PM   #17
t0mat0
macrumors 601
 
t0mat0's Avatar
 
Join Date: Aug 2006
Location: Home
Quote:
Originally Posted by RNDesigns View Post
I checked my mail. I need a way to get in touch with you.
PM me.
__________________
Whither Skylake?
t0mat0 is offline   0 Reply With Quote
Old May 23, 2009, 01:44 PM   #18
firewood
macrumors 603
 
Join Date: Jul 2003
Location: Silicon Valley
The suggestions here are garbage.

If you are having trouble, then learn a really simple programming language first, not Obj-C for Mac OS.

Look in the children's section of your local library and see if there are any easy intro to programming books there. Look for a beginning programming book you find entertaining and can understand quickly, doesn't matter if it's for Logo or Basic, or some other currently unfashionable language. Script a few really ugly web pages using HTML and Javascript. Or play with perl, python or Squeak on your Mac.

Then move on to C and Obj-C. You will know far more in the end.

In the early days of military aviation, they put smart strong recruits directly in regular line aircraft, and some really huge percentage were killed. Then they made new pilots learn their chops in little ground trainers that looked more like toy amusement park rides, and the rate of dead pilots went way down.


ymmv.
firewood is offline   0 Reply With Quote
Old May 23, 2009, 06:53 PM   #19
carlosbutler
macrumors 6502a
 
carlosbutler's Avatar
 
Join Date: Feb 2008
Location: London City
i agree with the previous poster. although programming in children's section is a bit strange, but w/e

start of with the most basic of coding, HTML, PHP, Javascript and then try Java if you want. There are loads of things on Java, and some great development programs such as Eclipse or NetBeans.

Once you have an understanding of php and javascript or java for example why if, else if, loops, classes, methods, method overloading, polymorphism etc then you are all good to start basics of C or something like that.

ive only just started first year of computer science and we have been taught html, css, php, haskell, java, sql and other things. haskell was the weirdest one, but all really easy.
__________________
24" iMac, 3GHz, 15" MacBook Pro quad
iPod Classic, iPod Nano, Apple TV
iPhone since release of original
easy-bills.co.uk
carlosbutler is offline   0 Reply With Quote
Old May 23, 2009, 11:21 PM   #20
iBadger
macrumors member
 
Join Date: Apr 2009
I know you are looking for C programming but you want to learn the fundamentals. I'd recommend checking out Java for your first language. My university switched from C++ to Java and the community colleges around me now use Java. Once you get the basics down you can pick up any language.

You can download a simple straight forward IDE like - Dr. Java
http://www.drjava.org/
Easy enough to get you programming fast and you won't have to worry about all the bells and whistles of other IDE's.

As far as books I highly recommend - Building Java Programs: A Back to Basics Approach .
Look around pick it up USED $40- http://www.amazon.com/Building-Java-...3138133&sr=1-1

It's a book for the classroom, it is straight forward with plenty of small programs/projects at the end of each chapter. It starts out with the very basic and get you into more advanced stuff.
__________________
Unibody MacBook 2.0
Saving for 17" Macbook Pro
iBadger is offline   0 Reply With Quote
Old May 23, 2009, 11:43 PM   #21
skochan
macrumors regular
 
Join Date: Apr 2006
Location: California
 
I guess I'll add my 2 cents to this discussion. First, I agree that an understanding of some basic programming concepts is helpful. I don't agree, however, that you should learn a language like Java or C first. I have posted elsewhere in this forum my opinion that learning a procedural language if your goal is an object-oriented one is a mistake. Why learn an approach to programming that you later have to essentially "unlearn"? It's much better to start with an object-oriented approach to problem solving, algorithm development, and program construction. If Objective-C were not a superset of C, I wonder if learning C would still be recommended first? I doubt it. That's not to say that later on you will not need to learn things like structures, pointers, etc., but why learn all that before you learn how to define a class or send a message to an object?

If you do decide to use my book, there's a good support site for the book that exists to help you with your questions, I'm active there as are the other members who are very willing to lend a hand.

Best of luck,

Steve Kochan
skochan is offline   0 Reply With Quote
Old May 24, 2009, 01:19 AM   #22
firewood
macrumors 603
 
Join Date: Jul 2003
Location: Silicon Valley
If Objective-C weren't a superset of C it would be Squeak... a very attractive academic and teaching language that has (rounded) 0.0% traction in the real world.

I wish there were books on Squeak programming, but does it have enough market share to interest a good author?

C works because it's almost just a macro assembly language for DEC minicomputers... and now for RISC micros. You can use C to make code run real fast on real hardware with very little memory (and cache, and battery power). Perfect for mobile and green computing.

Dynamic OOP allows one to rapidly create more reliable apps that scale up better. Perfect for RAD, rich GUI and maybe distributed cloud computing.

The marriage is what made this hybrid language succeed (and continue to succeed).

IMHO.
firewood is offline   0 Reply With Quote
Old May 24, 2009, 04:03 AM   #23
skochan
macrumors regular
 
Join Date: Apr 2006
Location: California
 
Quote:
Originally Posted by firewood View Post
C works because it's almost just a macro assembly language for DEC minicomputers... and now for RISC micros. You can use C to make code run real fast on real hardware with very little memory (and cache, and battery power). Perfect for mobile and green computing.
IMHO.
I'm not disagreeing with your statements; however you could extend the argument to learning assembly language before C, and I don't think that's necessary either. Once again, I agree that C needs to be learned, but as a teacher, I'd rather not have a student have to learn all about functions, structures, malloc, pointers, etc. before defining their first class or sending their first message (This is for new programmers once again.)

I think tackling a problem from an object-oriented perspective is very different from approaching the problem procedurally. So why learn one approach to programming first and then have to almost unlearn it after? Of course, a combination of the two approaches will ultimately be the best tools for the programmer.

As an example, early in my book I introduce a Fraction class and develop methods for performing operations on them like addition, subtraction, etc. If you learn C first, you'll write functions to do similar things and pass around structures. That just doesn't seem like the right pedagogical approach to me.

I welcome this discussion as I spent a long time deciding to take the approach of not teaching C first.

IMHO.
skochan is offline   0 Reply With Quote
Old May 24, 2009, 12:43 PM   #24
firewood
macrumors 603
 
Join Date: Jul 2003
Location: Silicon Valley
I recall a undergraduate computer survey course for non-majors. University of California campus. Long ago. No textbook, since the survey covered a dozen completely different topics in computing. The only programming language they introduced was a toy assembly language for a cardboard computer. Not in any real detail of course, but the professor wanted even non-programming students to have a feel for the underlying machine before going off onto other survey topics such as AI, social aspects of computer use, and etc.

So, yes, I could extend the argument that the first chapter of an intro to computing book should start off with an assembly language (in a safe emulated environment).

Then I would skip to something like Squeak, Logo, Basic, or some other well sandboxed early education language, where one can get some fun and immediate output with only a very few lines of code, and not knowing the details isn't dangerous. It's far easier to learn to experiment with and debug algorithms in this kind of environment.

Then I might move on to C and Obj-C.

Then the novice programmer would have a better chance of realizing that they are working in the middle of an abstraction ladder, and hopefully post less unbelievably clueless questions here.


imho.
__________________
Apple II+, Mac 128k->512ke, Duo 210, MacBook Air 11, iPhone 5, iPad Mini Retina
firewood is offline   0 Reply With Quote
Old Apr 21, 2010, 09:16 AM   #25
hudsonr
macrumors newbie
 
Join Date: Aug 2009
Location: Houston, Texas
Send a message via Yahoo to hudsonr
Beginner - Objective-C

To all:

I have no programming experience and have purchased Steve Cochan's Objective - C 2.0 book/video. I have just gotten started and would also be interested in taking structured classes. I have check around on the web and classes on Objective-C range from 2-7 days and do not include meals and travel at a cost of $1500-$5000. That's a lot of money for a 2-7 day class in my opinion.

Can anyone suggest where I cam get hands-on training for Objective-C at a more affordable price? I am located in Houston, Texas.

Any comments are welcome.

Thanks!

Hudson Reed
Houston, Texas
hudsonr is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Xcode Objective C - syntax is wrong msUnique iPhone/iPad Programming 1 Mar 3, 2013 06:38 PM
I Need Help Learning Objective-c!! Woodshark69 Mac Programming 11 Dec 14, 2012 07:21 AM
Learning Objective C iPadProd iPhone/iPad Programming 4 Nov 18, 2012 05:37 PM
Objective C Syntax nashyo iPhone/iPad Programming 6 Jul 4, 2012 11:56 AM

Forum Jump

All times are GMT -5. The time now is 07:37 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC