home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5163 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.9 KB  |  40 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!psinntp!cubetech.com!imladris!andrew
  3. From: andrew@cubetech.com (Andrew Loewenstern)
  4. Subject: Re: Question about visibility of interface variables
  5. Message-ID: <1992Jul21.085952.21046@cubetech.com>
  6. Organization: Cube Technologies, Inc.
  7. References: <20JUL92.11345443@enh.nist.gov>
  8. Date: Tue, 21 Jul 1992 08:59:52 GMT
  9. Lines: 29
  10.  
  11. In article <20JUL92.11345443@enh.nist.gov> aoml@enh.nist.gov writes:
  12. >I need to have a couple of variables which are specific to the particular nib
  13. >section that is loaded.  (I have several of the same nib files on screen at the
  14. >same time, but each must have its own, discrete data set).  I figure that by
  15. >putting these variables in the @interface section of the header file, they
  16. >will be specific, like I need.  However, a large part of my file consists of
  17. >regular C functions (which run faster, I think, than methods).  When I put the
  18. >variables in the @interface section, my functions can no longer see them.  I
  19. >can see what is going on here, and where my problem is.  Does anyone know of a
  20. >better way of handling this than changing my functions into methods?  Thanks.
  21. >Kevin
  22.  
  23. Make all of the functions that need to access instance variables into
  24. methods belonging to that class.  Forget functions and let the
  25. Objc-Runtime do the work for you.  Unless you need to call a
  26. function/method more than about 700,000 times in a row as fast as
  27. possible, you won't win anything by using a function, and in that
  28. case, you would still use a method and call methodFor: right before
  29. you call the method 3 million times...
  30.  
  31. The overhead for a method call isn't a whole lot more than that of a
  32. function (which isn't a whole lot in the first place)...
  33.  
  34.  
  35. andrew
  36. -- 
  37. andrew@cubetech.com
  38. Andrew Loewenstern      | "If I am not for myself, who will be for me?
  39. Cube Technologies, Inc. |  If I am only for myself, who am I?" -Hillel
  40.