RE: A simple Objective-C question
RE: A simple Objective-C question
- Subject: RE: A simple Objective-C question
- From: "john darnell" <email@hidden>
- Date: Thu, 10 Apr 2008 13:28:33 -0500
- Thread-topic: A simple Objective-C question
Mr. Krishna:
I, too am new to Objective-C, but in the two books I have been
studying on the language, they both make the point that Objective-C
plays nicely with both C and C++. Could you simply write a standard C++
class and instantiate it the same way one does with other C++ classes
(i.e. by declaring it, or by using the new operator)?
R,
John
-----Original Message-----
From: cocoa-dev-bounces+john.darnell=email@hidden
[mailto:cocoa-dev-bounces+john.darnell=email@hidden] On
Behalf Of Rama Krishna
Sent: Thursday, April 10, 2008 1:22 PM
To: email@hidden
Subject: A simple Objective-C question
I am new to Objective-C but I have done C++/C#/Java work. I have been
doing
some experiments to understand how the language works. I found that it
is
not necessary for an Objective-C class to derive from Object. I was able
to
create a class which did not derive from Object contrary to my
assumption
that all Objective-C classes implicitly derive from Object (such as in
C# or
Java).
However, such a class has a problem. It cannot be allocated or
initialized.
Because it can never get the alloc message as the alloc message is
declared
in the Object class. My question ,therefore, is how can such classes be
instantiated. Is there a library function for that? Surely, the standard
alloc function must be using such a function. Or should I just derive
all
classes from Object.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
h.com
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden