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

mck9235

macrumors newbie
Original poster
Feb 18, 2008
1
0
I'm trying to learn some of the basics of Cocoa by following along an Apple Developer guide. Currently, I have this Cocoa sample code that I want to run in XCode, but it simply won't let me build/run a single file.

I don't want to create a whole project, just run a simple file! Any help is appreciated. :) Let me know if I wasn't descriptive enough on anything.

Thanks
 

sord

macrumors 6502
Jun 16, 2004
352
0
Or you can compile with gcc.
Code:
gcc -framework Cocoa -o <output file> <input file>
(Or something like that -- I'm not by my OS X machine to test)
Not sure if this will work for applications with nibs, but for straight Obj-C + Cocoa it should. The O'Reilly "Objective-C Pocket Reference" explains exactly how to do it.

EDIT: I got off of my *** and grabbed the book - I was wrong, I can't remember which book it was that explains it.
 

azizane

macrumors member
Nov 27, 2006
49
0
I believe it's: gcc Filename(s) -o OutputFilename

I think you mean Stephen Kochan's "Programming in objective-c". Also not sure on applications with nibs.

Or you can compile with gcc.
Code:
gcc -framework Cocoa -o <output file> <input file>
(Or something like that -- I'm not by my OS X machine to test)
Not sure if this will work for applications with nibs, but for straight Obj-C + Cocoa it should. The O'Reilly "Objective-C Pocket Reference" explains exactly how to do it.

EDIT: I got off of my *** and grabbed the book - I was wrong, I can't remember which book it was that explains it.
 

azizane

macrumors member
Nov 27, 2006
49
0
I believe it's: gcc Filename(s) -o OutputFilename

I think you mean Stephen Kochan's "Programming in objective-c". Also not sure on applications with nibs.

Update: sorry got posted twice by mistake :s

Or you can compile with gcc.
Code:
gcc -framework Cocoa -o <output file> <input file>
(Or something like that -- I'm not by my OS X machine to test)
Not sure if this will work for applications with nibs, but for straight Obj-C + Cocoa it should. The O'Reilly "Objective-C Pocket Reference" explains exactly how to do it.

EDIT: I got off of my *** and grabbed the book - I was wrong, I can't remember which book it was that explains it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.