On Thu, Apr 10, 2008 at 1:22 PM, Rama Krishna <[EMAIL PROTECTED]> wrote:
> 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. > I could be wrong, but I think you can build a +alloc message using NSAllocateObject. However, to make your class behave well with the rest of Cocoa, you'll also need to implement a large part of the NSObject protocol. Unless you have a very good reason (no offense, but beginners rarely do) then you should inherit from NSObject instead. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]