Cocoa with C++, instead of Objective-c?
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.
PyObjC and RubyCocoa are much better bets if you want Cocoa without ObjC.
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.
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.
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.
I also completely agree with everything Andrew just said.
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)
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
Code:
id foo = [[NSMutableArray alloc] init];
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

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:
Code:
//... more code above
@interface Simple : NSObject
{
NSNumber num;
NSString *name;
}
-(void) setName:(NSString *)nme;
-(void) setNumber: (NSNumber)nmb;
-(NSString *) getName;
-(NSNumber) getNumber;
@end
@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;
}
@end
int main()
{
Simple *smp;
smp = [[Simple alloc] init];
[smp setName:@"Your Name"];
NSLog(@"%@ is your name", [smp getName]);
[smp release];
return 0;
}
}
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.
Thanks,
Erwin
That would be helpful for people new to MacOS X as learning resource.
Preferably under a liberal license, like Zlib, MIT or BSD.
Thanks,
Erwin
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.
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.
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
Using Cocoa/objective-c in C++ | nightition | 3 | 5,153 |
Oct 3, 2007 11:39 AM Last Post: MattDiamond |