home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.next.programmer:5936 comp.lang.objective-c:513
- Path: sparky!uunet!richsun!richsun.cpg.trs.reuter.com
- From: jack@richsun.cpg.trs.reuter.com (Jack Gidding)
- Newsgroups: comp.sys.next.programmer,comp.lang.objective-c
- Subject: Multiple init: functions defined
- Message-ID: <3575@richsun.cpg.trs.reuter.com>
- Date: 2 Sep 92 20:37:28 GMT
- Sender: news@richsun.cpg.trs.reuter.com
- Followup-To: comp.sys.next.programmer
- Lines: 40
-
-
- Hmmmm..... this is really strange and very undesired behavior from Objective-C.
-
- When I include the header files from two different classes into a third class,
- and each of the included classes have a single init: method defined, I get
- messages similar to the following:
-
-
- main2.m:18: warning: multiple declarations for method `init:'
- /Clib/RP.h:32: using `-init:(int )pSize'
- /Clib/RS.h:31: also found `-init:(OBJPTR )s'
-
-
- Why is this happening??? Sometimes it tells me that it resolved which init to
- use, sometimes not, and sometimes it resolves it to the wrong init:.
-
-
- The code that has the init method is sililar in form to:
-
- #import <RP.h> // Both RP and RS have and init: method
- #import <RS.h>
-
- id x;
-
- x = [[RP alloc] init:(int) 5];
-
- id is totally dynamic, and thus it really does not know which init to use....
-
- So, why is it telling me that it is using one method or another...shouldn't
- this be left up until run-time?
-
-
- Am I doing something wrong to cause this?
-
-
- Thanks,
-
-
- Jack Gidding
- jack@richsun.cpg.trs.reuter.com
-