Help with Xcode please!

Tyaedalis

Registered
I don't know how to make just an Objective-C file, and not C++. Can I do this at all? I'm also very new (just started learning yesterday) to the language.
 
File > New File, then under the Cocoa heading select Objective-C class and press Next. Then enter the class name for your Objective-C object and leave the .m extension.
 
If you're making a GUI application, choose Cocoa Application. If it is going to be text based, use Foundation tool.
 
Tyaedalis said:
I don't know how to make just an Objective-C file, and not C++. Can I do this at all? I'm also very new (just started learning yesterday) to the language.


From my point, you will need to know Objective-C as "a programming language" then you need to know the in's and out's of Interface builder and how they interact together to form a single application.

Really, I would rather use C++, Objective-C syntax just seems to me to complicate things versus C++ which has been widely popular, across all platforms, for many years now. Not really many books on the subject of using Xcode tools to program in C++ and interconnect to resource files built with Interface builder though.

I know where you are coming from though. After running around a few tutorials, etc, the last few days getting familiar with Cocoa and Objective C, I decided to order a couple of books. As recommended to me, Learning Objective-C and Cocoa Programming.
 
Objective-C syntax is super easy to read.

Pretty much if you know C++ or Java, you can pick up Objective-C pretty easily.
Code:
// C++/Java
object.method(value);

// Objective-C
[object method:value];
Now learn the syntax for classes, and you're set :D
 
The only gripe I have with objective-C is that it is very verbose. This verbosity is sold as a feature, being self documenting and all that.
 
oops! i meant plain C, not objective C. I know i need to learn C++, and I'm going to as soon as i learn more C.
 
Back
Top