N!K wrote:

However, exactly the same statement fails when pasted into -init of Class.m.

Build yields "warnings  Class may not respond to -new."


This message suggests you're calling an instance method, not a class method, or that's the way the compiler is interpreting it.

Post your actual failing code, in the complete method where it fails.

For example, is your class really named Class? If so, then that won't work. The reason is that Class is already a defined type, and it doesn't descend from NSObject. See the return type of the NSObject method -class. Look it up in "The Objective-C Programming Language" reference doc, under the heading "Defined Types", or see the include file "objc/objc.h".

Furthermore, since +new is defined as +alloc followed by -init, calling +new in -init seems a little recursive to me, but without seeing actual code, it's just a guess.

  -- GG

_______________________________________________

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 arch...@mail-archive.com

Reply via email to