On Mar 12, 2013, at 9:44 AM, John McCall <rjmcc...@apple.com> wrote:
> However, that wouldn't be an idiomatic implementation. The usual expectation > is that allocating methods, like +new methods, construct an object *of type > self* (at least). Are you just quibbling about the prefix “new-“? The specific method +new is expected to create a new instance of the receiving class, yes. There may be a convention (I can’t remember?) that class methods prefixed “new-” are intended to do the same. However, it’s hardly unusual to have a class method that instantiates and returns some other kind of object. Dave’s use case of a dictionary that describes metadata about the class seems reasonable. > This is why I was talking about instance methods and fields: because, > generally, people introduce new classes because they expect to create > instances of them, and [[self superclass] newDict] bypasses that in a way > that might not be obvious. I don’t see the problem here. Presumably the class is going to be instantiated at some point, but the code Dave is working with is operating on metadata about the class, so only class methods are involved in it. —Jens _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com