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

Sandy Santra

macrumors 6502
Original poster
Feb 1, 2008
350
73
Brooklyn
I've worked on very simple Cocoa apps a couple of times in Xcode and there's something that keeps confusing me.

As I understand it, after I create connections between buttons and class instances, I'm supposed to (over)write the class files [ClassName].m and [ClassName].h. That works fine, yup, and these files have the code in them that they're supposed to.

But every book I've read said the files are supposed to land (get stored in) the Xcode "Classes" (virtual) folder in the left sidebar in Xcode. They don't. They always end up under the "Resources" folder, along with things like Info.plist, InfoPlist,strings, and MainMenu.xib.

This just doesn't seem right, if every book says that they're supposed to end up in the Classes folder.

Are my books out of date? Did something change in Xcode 3.1.2? Or maybe I'm setting up the project wrong, or saving the class files wrong, or have a Preferences setting screwed up?

I could really use some help on this oddity if anyone can think of something.

Thanks in advance!
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
It doesn't matter where they are in those virtual folders really. If it bothers you just drag them to the "correct" location.
 

Sandy Santra

macrumors 6502
Original poster
Feb 1, 2008
350
73
Brooklyn
Yeah, I just saw the same sentiment echoed on a blog:

"if you switch back to Xcode, you'll see the generated files in your project window, inside the Classes group. If they appear in the Resources group, or a different group, simply select and then drag them to the Classes group"

But it's driving me nuts not understanding why Xcode/IB is saving them to the wrong group.
 

Sandy Santra

macrumors 6502
Original poster
Feb 1, 2008
350
73
Brooklyn
XCode puts them in the group that was selected when you executed the command.

OMG--that's it!!!

You saved my life.

After 3 hours of research in 4 different areas--Google, Xcode mailing list, Xcode program resources, Twitter--YOU ARE THE MAN.

Thank you thank you thank you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.