A simple Objective-C question
A simple Objective-C question
- Subject: A simple Objective-C question
- From: "Rama Krishna" <email@hidden>
- Date: Thu, 10 Apr 2008 14:22:05 -0400
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:
This email sent to email@hidden