Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.objective-c > #158

Re: resource management and constructors question

From Doc O'Leary <droleary@2usenet2014.subsume.com>
Newsgroups comp.lang.objective-c
Subject Re: resource management and constructors question
Date 2015-02-10 15:31 +0000
Organization Subsume Technologies, Inc.
Message-ID <mbd893$a2b$1@dont-email.me> (permalink)
References <slrnmdjp8g.88b.automn@sigtrans.org>

Show all headers | View raw


For your reference, records indicate that 
Automn <automn@willow.org> wrote:

> Hello,
> 
> I have a bit of experience in Smalltalk and Objective-C but someone told me
> something I do not understand :
> 
> Why cannot you overload the -new method for construction ? It does not 
> operate on classes but on instances AFAIK so I can retain data in it but 
> apparently no one wants to have a clean interfaced -new overloaded method ?

You cannot overload -new because it doesn’t exist (at least not in the
common Object or NSObject hierarchies).  There is +new and there is -init.
I have no idea what you want a -new method to do, but you’re welcome to
use it.  Be sure to document it extremely well if you share your code,
because it could lead to confusion.

-- 
"Also . . . I can kill you with my brain."
River Tam, Trash, Firefly

Back to comp.lang.objective-c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

resource management and constructors question Automn <automn@willow.org> - 2015-02-10 10:58 +0000
  Re: resource management and constructors question Doc O'Leary  <droleary@2usenet2014.subsume.com> - 2015-02-10 15:31 +0000
    Re: resource management and constructors question Automn <automn@willow.org> - 2015-02-10 19:34 +0000

csiph-web