Article View: comp.sys.next.programmer
Article #168Re: Question about visibility of interface variables
From: Andrew Loewenstern
Date: Tue, 21 Jul 1992 08:59
Date: Tue, 21 Jul 1992 08:59
29 lines
1941 bytes
1941 bytes
In article <20JUL92.11345443@enh.nist.gov> aoml@enh.nist.gov writes: >I need to have a couple of variables which are specific to the particular nib >section that is loaded. (I have several of the same nib files on screen at the >same time, but each must have its own, discrete data set). I figure that by >putting these variables in the @interface section of the header file, they >will be specific, like I need. However, a large part of my file consists of >regular C functions (which run faster, I think, than methods). When I put the >variables in the @interface section, my functions can no longer see them. I >can see what is going on here, and where my problem is. Does anyone know of a >better way of handling this than changing my functions into methods? Thanks. >Kevin Make all of the functions that need to access instance variables into methods belonging to that class. Forget functions and let the Objc-Runtime do the work for you. Unless you need to call a function/method more than about 700,000 times in a row as fast as possible, you won't win anything by using a function, and in that case, you would still use a method and call methodFor: right before you call the method 3 million times... The overhead for a method call isn't a whole lot more than that of a function (which isn't a whole lot in the first place)... andrew -- andrew@cubetech.com Andrew Loewenstern | "If I am not for myself, who will be for me? Cube Technologies, Inc. | If I am only for myself, who am I?" -Hillel
Technical Details
Message-ID:
<1992Jul21.085952.21046@cubetech.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!psinntp!cubetech.com!imladris!andrewReferences:
<20JUL92.11345443@enh.nist.gov>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!psinntp!cubetech.com!imladris!andrew From: andrew@cubetech.com (Andrew Loewenstern) Subject: Re: Question about visibility of interface variables Message-ID: <1992Jul21.085952.21046@cubetech.com> Organization: Cube Technologies, Inc. References: <20JUL92.11345443@enh.nist.gov> Date: Tue, 21 Jul 1992 08:59:52 GMT Lines: 29