ftp.nice.ch/peanuts/GeneralData/Usenet/news/1991/CSNProg-91.tar.gz#/comp-sys-next-programmer/1991/Nov/More-on-ObjC-coding-style?

This is More-on-ObjC-coding-style? in view mode; [Up]


Date: Sun 07-Nov-1991 19:31:16 From: strauss@aero.org (Daryll Strauss) Subject: More on ObjC coding style? I've got a comment and question about ObjC coding style. First, my general preference is to have the compiler warn me about potential problems as much as possible. I'm perfectly happy using a type cast when I'm "cheating" (or just confusing the compiler ;-) So, I tend to use the most specific class possible for variable declarations. Here's the problem. I have two interdependent classes, and I would like to fully specify the fields in them. For instance: @interface classA:Object { classB *field1; } @end @interface classB:Object { classA *field2; } @end The problem is that I can't declare the field to be classB within classA, because classB hasn't been defined, yet. In C/C++, I would do: extern struct/class classB; But there doesn't appear to be a way to do that in ObjC. Am I missing something? Is there a way? I know that I can just make one of them an id, but then I lose all my error checking. Daryll Strauss f The Aerospace Corp. strauss@aero.org n Mail Stop: M1-102 ...!uunet!aero.org!strauss o P.O. Box 92957 "It's my reality and I'll warp it if I want to!" d (213) 336-9358

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.