Advertisement

Mac OSX newb possibly stupid questions

Started by April 06, 2005 01:10 AM
-1 comments, last by UselessRob 19 years, 7 months ago
Howdy I've started fiddling with some Mac OSX programming after getting bored with Windows, but there's something that I can work out (actually lots of things, but this one's stopping me going further for now): How do I use a normal C++ class variable in one of the main NSView class thingys? It seems in a .m file (objective-c) it will always complain about the class being defined in an #include'd file. If it's a .mm file, it compiles fine, but then I get a single error that makes no sense. It simply says "Undefined Symbols:" without actually saying what symbols are undefined. Obviously, simply renaming the file to .mm isn't the way to go. :) But I can't find any of the files I can add to xcode, or any of the projects you start with, that let you start with a .mm file anyway. So question is, how do I use C++ classes in a view class. I'm starting by trying to do a screensaver. So I've started a Screen Saver project, no worries there. But I'm using code I've written in c++ for the drawing and all that, so I need to have a variable of that class in the view class. I hope this makes sense to someone, and I apologise for being clueless! Rob.

This topic is closed to new replies.

Advertisement