🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
2 messages
2 total messages Started by Lloyd P. Goldwasser Tue, 21 Jul 1992 23:44
Accessing the values of variables in other objects?
#163
Author: Lloyd P. Goldwasser
Date: Tue, 21 Jul 1992 23:44
26 lines
1209 bytes
Here's a simple Objective-C question with, I suspect, a simple yes-or-no  
answer.

Is it possible to access directly the values of variables in other objects?

  e.g., [anotherObject whatIsTheValueOf: this_variable];
  and   [anotherObject whatIsTheValueOf: that_variable];

It would be convenient not to have to dedicate a whole method to transferring  
the value of this_variable only; i.e., without putting

   - tellTheValueOfThisVariable:(float *)dummy_variable
   {
     *dummy_variable = this_variable;
   }

into the implementation of anotherObject.

Simply including the header file of the other object doesn't seem to do the  
trick.


Thanks in advance,

Lloyd Goldwasser
goldly@u.washington.edu
Re: Accessing the values of variables in other objects?
#167
Author: Scott Anguish
Date: Wed, 22 Jul 1992 00:21
15 lines
1005 bytes
Lloyd P. Goldwasser writes
> Here's a simple Objective-C question with, I suspect, a simple yes-or-no  
> answer.
> 
> Is it possible to access directly the values of variables in other objects?

	The best way is to do it with the method returns value style.

	Otherwise, you aren't really working in a very Object Oriented way,  
plus you don't get the benefit of being able to change the variable type,  
without having to change anything in the objects that actually use it.

-- 
- Scott Anguish -
sanguish@digifix.com (NextMail)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads