Cocoa with C++, instead of Objective-c?

Posts: 5,143
Joined: 2002.04
Post: #16
Cocoa/Java is deprecated; you shouldn't use it for new projects.

PyObjC and RubyCocoa are much better bets if you want Cocoa without ObjC.
Quote this message in a reply
Posts: 208
Joined: 2005.04
Post: #17
It shouldn't take more than 2 hours to get a good handle on Objective-C, especially if you have Hillegass' book. Start reading the book from the very beginning, and actually write/run the code he shows you.

The most difficult thing for most people to grasp in Cocoa isn't the Objective-C language itself; it's the Cocoa API. The API is beautifully engineered, but it is very different from other APIs you might have seen.

As for Objective-C++, don't touch it with a 10 foot pole until you have a FIRM grasp of Objective-C. Its purpose is to allow you to mix C++ and Objective-C code. It is NOT an alternative to Objective-C.
Quote this message in a reply
⌘-R in Chief
Posts: 1,237
Joined: 2002.05
Post: #18
I learned Objective-C in an hour. It's ridiculously simple, and I quite agree with OSC that it's the antithesis of C++.

I also completely agree with everything Andrew just said.
Quote this message in a reply
Posts: 312
Joined: 2006.10
Post: #19
Yeah, last night I re-readover the first 100 pages of the book, and I know I feel much more comfortable with it. Before, when I first started reading "Cocoa Programming" I didn't understand how the methods worked, and declarations of classes and the allocation and init methods (why they were used)
id foo = [[NSMutableArray alloc] init];
Overall, the difference between know and when I started reading the book, I have a better grasp of programming (and pointers and memory management in particular) then before.

Know the syntax, and basic concepts that I've read make sense now. And I must say, I do appreciate how Objective-C is "styled"!

Btw, as Andrew says its the cocoa API that is more difficult, I thought some parts of Cocoa were apart of the Objective-C language Rasp
Quote this message in a reply
Post: #20
I've found that Objective-C/Objective-C++ combined with C++ is a great way to program. Objective-C is easier to program in, in my opinion. Here's just a simple class that extends NSObject - NOTE THIS IS NOT THE FULL CODE:

//... more code above
@interface Simple : NSObject
NSNumber num;
NSString *name;

-(void) setName:(NSString *)nme;
-(void) setNumber: (NSNumber)nmb;
-(NSString *) getName;
-(NSNumber) getNumber;


@implementation Simple
-(void) setName:(NSString *)nme
nme = [nme copy];
[name release];
name = nme;

-(void) setNumber:(NSNumber)nmb
num = nmb;

-(NSString *) getName
return name;

-(NSNumber) getNumber
return num;


int main()
Simple *smp;
smp = [[Simple alloc] init];
[smp setName:@"Your Name"];
NSLog(@"%@ is your name", [smp getName]);
[smp release];
return 0;
Quote this message in a reply
Posts: 27
Joined: 2006.07
Post: #21
akb825, could you release the source code for your Monkey3D application, even if its work-in-progress?

That would be helpful for people new to MacOS X as learning resource.
Preferably under a liberal license, like Zlib, MIT or BSD.

Quote this message in a reply
Posts: 1,140
Joined: 2005.07
Post: #22
I was planning on releasing the source under the BSD license once I do a bit more real-world testing. I'm pretty close to that testing, but I'll consider releasing the source earlier with a note that it's not completely tested yet.
Quote this message in a reply
Posts: 567
Joined: 2004.07
Post: #23
unknown Wrote:There is java libraries.
Just make a new cocoa java program in Xcode

why, out of interest? They certainly aren't portable.

It's not magic, it's Ruby.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Using Cocoa/objective-c in C++ nightition 3 3,476 Oct 3, 2007 11:39 AM
Last Post: MattDiamond