• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: multiple declarations for method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple declarations for method


  • Subject: Re: multiple declarations for method
  • From: "Erik M. Buck" <email@hidden>
  • Date: Sat, 26 Jan 2002 14:49:50 -0600

Try either

- (id)initWithParent:(id)aParent
{
NSAssert([aParent isKindOfClass:[TypeA class]], @"Attempt to initialize
with invalid parent");
...
}

or

- (id)initWithTypeAParent:(TypeA *)aParent;

and

- (id)initWithTypeBParent:(TypeB *)aParent;

or

Use a protocol rather than a class name for the type of the argument and
make all parents conform to the same protocol.

or

Try a different requirements for parenthood. Maybe parents are just id.
Not everything has to be completely statically typed even though it is a
good practice. Notice that the initializers all return id so that they work
correctly when inherited.

----- Original Message -----

References: 
 >multiple declarations for method (From: Kim Foo-Jones <email@hidden>)

  • Prev by Date: Re: AppleEvents, CGIs, Cocoa
  • Next by Date: Sample code - building an Apple Event in a Cocoa application?
  • Previous by thread: multiple declarations for method
  • Next by thread: Re: theoretical idea - would this work?
  • Index(es):
    • Date
    • Thread