 |
 |
xcode
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Oct 2004
Status:
Offline
|
|
I need to learn how to use xcode. What should i do?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2003
Status:
Offline
|
|
Originally posted by lord vader:
I need to learn how to use xcode. What should i do?
1. Read
2. Study
Complete those two steps and you'll be ahead of the game.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2000
Status:
Offline
|
|
I started learning cocoa 22 jan.
Yesterday, (actually about 20 hours later), I finished a fully-fledged (well maybe not THAT fully-fledged) Bezier-path editor in which you can draw paths, set colors, toggle bezier handles and change the stroke width "live".
I was really sceptical towards Objective-C in the beginning, having done time in both C, C++ and Java. My first reaction was that Apple is doing everything they can to make an old dusty idea sound new and good, and the only people supporting it are out-of-employment retired eX-neXt-geeX orthodox enough never to give Java or C++ even a first chance.
I still don't know about that, so I'd be glad to hear a professional opinion (from someone "entitled" to compare it to Java and C++).
Anyway, from what I've seen of the Cocoa framworks, it seems really powerful. The way it integrates into InterfaceBuilder allows you to easily extend your application and explore new ground - it took me about 30 seconds to add a check box to my stupid application, from null to full implementation (well at least it would if I were to do it again).
The way Cocoa classes are structured is also quite cool. Back in OS 9 you had to write an entire main event loop in order for you application to do anything at all, and if you lost a pointer or whatever, Mac OS would make you aware of it by restarting your computer for you. In Cocoa, all you do is tell an object what to do if it gets for instance a mouseDown (overloading, like registering action listeners in Java, only cleaner, and faster. And more readable).
The only thing I miss are inline declarations of variables:
for (int i = 0 ... )
but I have the feeling someone in this thread is going to tell me real soon why I don't need that. :>
Anyway, I want to give you a few link tips as well:
I bet you found the Currency Converter tutorial - Apple's dev web site is full of it.
The next step I took was:
The Cocoa Tutorials of MacDevCenter
Next, check out http://www.cocoadev.com/.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by cla:
The only thing I miss are inline declarations of variables:
for (int i = 0 ... )
I haven't tried it myself, but you should be able to get that behavior by specifying the C99 standard, since it allows variable declarations anywhere in a code block. (I think you can specify a C dialect for Obj-C files, anyway.)
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Status:
Offline
|
|
Originally posted by Chuckit:
I haven't tried it myself, but you should be able to get that behavior by specifying the C99 standard, since it allows variable declarations anywhere in a code block. (I think you can specify a C dialect for Obj-C files, anyway.)
Yup. I always wonder why C89 is the default... I suppose I should look around for something to set so it isn't.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
I think C89 is the default because it's the standard that's been around for a long time. It offers maximum compatibility. Even though C99 is a standard, it isn't as standard a standard as C89. Does that make sense?
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2000
Status:
Offline
|
|
lol
The guy's original post was "I need to learn how to use xcode. What should i do?".
Five posts later we're talking: "gcc -std=c99" and "I think C89 is the default because it's the standard that's been around for a long time. It offers maximum compatibility. Even though C99 is a standard, it isn't as standard a standard as C89."
Poor lord vader... =]
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Status:
Offline
|
|
Originally posted by Chuckit:
I think C89 is the default because it's the standard that's been around for a long time. It offers maximum compatibility. Even though C99 is a standard, it isn't as standard a standard as C89. Does that make sense?
Yeah, I meant for new projects, actually. I know how to turn it on per-project without bothering with typing out CLI switches.
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Apr 2001
Status:
Offline
|
|
or (int i = 0 ... )
but I have the feeling someone in this thread is going to tell me real soon why I don't need that. :>
I'll tell you why you don't need it. It's bad programming practice. Different compilers will have different behavior. Just avoid it. Declare your for loop counter at the top of the function.
Wade
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by Catfish_Man:
Yeah, I meant for new projects, actually. I know how to turn it on per-project without bothering with typing out CLI switches.
Ah, sorry, misunderstood. Well, I'd imagine you could just edit it in the appropriate project template in /Library/Application Support/Apple/Developer Tools/Project Templates. Have you tried that?
Originally posted by wadesworld:
I'll tell you why you don't need it. It's bad programming practice. Different compilers will have different behavior. Just avoid it. Declare your for loop counter at the top of the function.
But it is much more semantic and logical for a loop-control variable to be local to the loop. It tells us, "This variable is used as a loop counter and nothing else." Declaring it at the top of the function puts it on the same level as all the real, functional variables that aren't just there to support the requirements of C's loop constructs.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2000
Status:
Offline
|
|
Originally posted by Chuckit:
But it is much more semantic and logical for a loop-control variable to be local to the loop. It tells us, "This variable is used as a loop counter and nothing else." Declaring it at the top of the function puts it on the same level as all the real, functional variables that aren't just there to support the requirements of C's loop constructs.
Agreed. The extreme parallel would be to declare all variables global - that way you have all your variables neatly collected at the same place, and you know exactly where to look for declarations...
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Apr 2001
Status:
Offline
|
|
It's not about logic and semantics - it's about avoiding bugs.
Some compilers will scope the variable only in the for block. Others will scope it at the function level. You'll be one unhappy camper when you discover this was the cause of a bug that cost you many hours.
Wade
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by wadesworld:
It's not about logic and semantics - it's about avoiding bugs.
Some compilers will scope the variable only in the for block. Others will scope it at the function level. You'll be one unhappy camper when you discover this was the cause of a bug that cost you many hours.
This isn't an argument against declaring variables in for loops. It's an argument for using a compiler that properly implements the C99 standard (which, unless my memory is prematurely fading, says that option No. 1 is The Right Thing).
Writing good code should be your foremost concern, not propping up bad compilers.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|