Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Coolnat2004

macrumors 6502
Original poster
Jan 12, 2005
479
4
I have been writing PHP scripts for a while.. albeit not object-oriented ones (I haven't been able to find a scenario where that would be useful.. YET..). I've done a few simple Python scripts.. and I have a C book and a Python book over there collecting dust. I'm going to take a "Computer Science" course at my high school this year.. which supposably starts you out with Visual Basic to learn the concepts (?) and then dives into Java. I'm afraid that it's going to be a dumbed down "Use a program that writes the code for you" course.. but we'll see.

What I would like to do is start making some simple OS X applications. Where should I start?

Thanks in advance.

Edit: I understand that PHP supposedly is a bad first language to know because of it's freeness of variable types. However, I fully understand that concept so.. yeah..
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,629
Western US
This exact same thread is started about once a week. Just do a search in this board and you will come up with lots of info, no need for everyone to repost it all again. There's even a sticky that has a lot of good resources to get you started.
 

mduser63

macrumors 68040
Nov 9, 2004
3,042
31
Salt Lake City, UT
slooksterPSV said:
To develop OS X apps you need to know:
Objective-C and Cocoa or
Carbon and C++.

And my recommendation would be to learn Objective-C and Cocoa if you really just want to develop Mac apps. Programming in Objective-C by Stephen Kochan and Cocoa Programming for Mac OS X by Aaron Hillegass are the two books you should get (in that order).
 

macsrockmysocks

macrumors regular
Feb 21, 2006
233
0
mduser63 said:
And my recommendation would be to learn Objective-C and Cocoa if you really just want to develop Mac apps. Programming in Objective-C by Stephen Kochan and Cocoa Programming for Mac OS X by Aaron Hillegass are the two books you should get (in that order).

Those are the books I just ordered for me to get started. All the reviews looked good, so I am taking the dive. They should arrive in a couple of days:) , but Hurricane Katrina ravaged areas can take 10+ more days to arrive:mad:

EDIT: I am going crazy waiting for these books!! I can't wait to start!
 

slooksterPSV

macrumors 68040
Apr 17, 2004
3,544
306
Nowheresville
macsrockmysocks said:
Those are the books I just ordered for me to get started. All the reviews looked good, so I am taking the dive. They should arrive in a couple of days:) , but Hurricane Katrina ravaged areas can take 10+ more days to arrive:mad:

EDIT: I am going crazy waiting for these books!! I can't wait to start!
Here, here's a program you can try out:
Open XCode and start a new project (File->New Project... CMD+SHIFT+N)
Ok so go down to Cocoa App, we're not developing a cocoa app, but its what we have to use.
Choose a name for it and click Create, now open main.m and change the entire thing to look like this:

Code:
//main.m
//Editied by: [i]your name[/i]

#import <stdio.h>

int main(int argc, char* argv[])
{
 printf("Hello World! Welcome to the world of programming.\n");
 return 0;
}

Click the build icon with the hammer to build and run the app, you'll notice a window pop-up that has text in it with the text: Hello World! Welcome to the world of programming.
There is your first Objective-C app.
 

macsrockmysocks

macrumors regular
Feb 21, 2006
233
0
slooksterPSV said:
Here, here's a program you can try out:
Open XCode and start a new project (File->New Project... CMD+SHIFT+N)
Ok so go down to Cocoa App, we're not developing a cocoa app, but its what we have to use.
Choose a name for it and click Create, now open main.m and change the entire thing to look like this:

Code:
//main.m
//Editied by: [i]your name[/i]

#import <stdio.h>

int main(int argc, char* argv[])
{
 printf("Hello World! Welcome to the world of programming.\n");
 return 0;
}

Click the build icon with the hammer to build and run the app, you'll notice a window pop-up that has text in it with the text: Hello World! Welcome to the world of programming.
There is your first Objective-C app.

Hey, thanks for the invitation. Well, since its so late,( and my friends are making me do certain things tomorrow...:( :rolleyes: ) I am going to do that tomorrow. Hopefully the book will explain this in much more detail. I hope you guys will be able to hellp me.:D
 

maximile

macrumors member
Oct 27, 2003
32
0
Herefordshire, UK
Rather than diving straight into Objective C, you could consider making an interface around some of your Python scripts with PyObjC or something. Might be an easier way to start.
 

slooksterPSV

macrumors 68040
Apr 17, 2004
3,544
306
Nowheresville
Gotta start simple, I could have given him an app like this and really confused him:

Code:
//main.m
#import <stdio.h>
#import <objc/Object.h>

@interface Square : Object
{
 int originX, originY;
 float side;
}

- (void)setSide:(int)length;
- (void)setOriginX:(int)x;
- (void)setOriginY:(int)y;
- (void)setOriginX:(int)x andOriginY:(int)y;
- (float)area;
@end

@implementation Square
- (void)setSide:(float)length
{
 side = length;
}

- (void)setOriginX:(int)x
{
 originX = x;
}

- (void)setOriginY:(int)y
{
 originY = y;
}

- (void)setOriginX:(int)x andOriginY:(int)y
{
 originX = x;
 originY = y;
}

- (float)area
{
 return side*side;
}
@end

int main(int argc, char* argv[])
{
 Square *mySquare = [[Square alloc] init];
 [mySquare setSide:10.0];
 [mySquare setOriginX:120 andOriginY: 200];
 printf("%.2f", [mySquare area]);
 [mySquare free];
 return 0;
}

But come on, he'll learn that, I don't think i wanna scare the kid with that much code, that's why I did a basic Objective-C program. Yes the first program I posted was Objective-C using the standard library, it was a .m extension and used the #import preprocessor directive
 

macsrockmysocks

macrumors regular
Feb 21, 2006
233
0
slooksterPSV said:
Gotta start simple, I could have given him an app like this and really confused him:

Code:
//main.m
#import <stdio.h>
#import <objc/Object.h>

@interface Square : Object
{
 int originX, originY;
 float side;
}

- (void)setSide:(int)length;
- (void)setOriginX:(int)x;
- (void)setOriginY:(int)y;
- (void)setOriginX:(int)x andOriginY:(int)y;
- (float)area;
@end

@implementation Square
- (void)setSide:(float)length
{
 side = length;
}

- (void)setOriginX:(int)x
{
 originX = x;
}

- (void)setOriginY:(int)y
{
 originY = y;
}

- (void)setOriginX:(int)x andOriginY:(int)y
{
 originX = x;
 originY = y;
}

- (float)area
{
 return side*side;
}
@end

int main(int argc, char* argv[])
{
 Square *mySquare = [[Square alloc] init];
 [mySquare setSide:10.0];
 [mySquare setOriginX:120 andOriginY: 200];
 printf("%.2f", [mySquare area]);
 [mySquare free];
 return 0;
}

But come on, he'll learn that, I don't think i wanna scare the kid with that much code, that's why I did a basic Objective-C program. Yes the first program I posted was Objective-C using the standard library, it was a .m extension and used the #import preprocessor directive

Thanks for not trying to confuse me... but ^ did:eek: lol.
 

slooksterPSV

macrumors 68040
Apr 17, 2004
3,544
306
Nowheresville
Sorry, but the posters below were saying that the first prog had no Objective-C (obj-c for short) and they're right; its where you start in the book, its a start to Objective-C
 

DaveP

macrumors 6502a
Mar 18, 2005
506
433
And don't necessarily count out your VB class. That's where I started with programming. One of the things I really enjoyed was being able to make legit-looking Windows apps pretty simply. And if you get further into Windows programming getting familiar with Windows forms is quite helpful.

Also, you don't need to restrict yourself to only what your teacher wants. I did a lot of extra work as well as talking with my teacher and getting aproval to alter the assignments so they were a little more challenging.
 

Coolnat2004

macrumors 6502
Original poster
Jan 12, 2005
479
4
DaveP said:
And don't necessarily count out your VB class. That's where I started with programming. One of the things I really enjoyed was being able to make legit-looking Windows apps pretty simply. And if you get further into Windows programming getting familiar with Windows forms is quite helpful.

Also, you don't need to restrict yourself to only what your teacher wants. I did a lot of extra work as well as talking with my teacher and getting aproval to alter the assignments so they were a little more challenging.
Oh, definitely. I'm going to be going far above what's actually in the class, and I already know the teacher so she'll let me. I'll get a lot out of it I'm sure.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.