home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6015 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.5 KB  |  37 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!usc!rpi!psinntp!psinntp!cubetech.com!imladris!andrew
  3. From: andrew@cubetech.com (Andrew Loewenstern)
  4. Subject: Re: Multiple init: functions defined
  5. Message-ID: <1992Sep4.222419.15820@cubetech.com>
  6. Organization: Cube Technologies, Inc.
  7. References: <3575@richsun.cpg.trs.reuter.com>
  8. Date: Fri, 4 Sep 1992 22:24:19 GMT
  9. Lines: 26
  10.  
  11. In article <3575@richsun.cpg.trs.reuter.com> jack@richsun.cpg.trs.reuter.com (Jack Gidding) writes:
  12. >
  13. >Hmmmm..... this is really strange and very undesired behavior from Objective-C
  14. >
  15. >When I include the header files from two different classes into a third class,
  16. >and each of the included classes have a single init: method defined, I get  
  17. >messages similar to the following:
  18. >
  19. >
  20. >main2.m:18: warning: multiple declarations for method `init:'
  21. >/Clib/RP.h:32: using `-init:(int )pSize'
  22. >/Clib/RS.h:31: also found `-init:(OBJPTR )s'
  23.  
  24. This is because you have init: defined differently in two places.  In
  25. RP, you have init:(int)pSize while in RS you have init:(id)sender.
  26. This is a nono.  If you need an initializer that takes an int for the
  27. starting size, call it - initSize:(int)pSize, etc... and call that.
  28. Don't forget to call [super init]...
  29.  
  30.  
  31. andrew
  32. -- 
  33. andrew@cubetech.com     | "We shall not cease from exploration
  34. Andrew Loewenstern      |  And the end of our exploring
  35. Cube Technologies, Inc. |  Will be to arrive where we started
  36.                         |  And know the place for the first time." -T.S. Eliot
  37.