• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: pointers in objective-c?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pointers in objective-c?


  • Subject: Re: pointers in objective-c?
  • From: Negm-Awad Amin <email@hidden>
  • Date: Mon, 4 Aug 2008 08:31:06 +0200


Am Sa,02.08.2008 um 22:53 schrieb Keary Suska:

8/2/08 1:09 AM, also sprach email@hidden:

This is important for encapsulation. Every change of an object made
through a pointer will change the object for every other user of this
object, who refers using a different pointer.

Person* person = …
Person* person2 = person; // two pointers to still *the one and only*
object

This statement could be misleading, if only for semantic reasons. The
pointers in this example *are* the same, i.e. the address to which each
variable points (also the variable's value) is the same.
No, you have to different pointers with the same value. You would never say, that

int a = 5;
… // somewhere else:
int b = 5+3;

are the same int-vars. The are different int-vars with (accidentally?) the same value.


Person* pointer1 = … // an object, maybe inserted … … // Somewhere else Person* person2 = … // a selected object from anywehere, the same value

are not the same pointers, but two different pointers with the (accidentally?) same value.

Cheers



Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

Amin Negm-Awad email@hidden




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: pointers in objective-c? (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: Restarting an app -- AppleScript 'launch' in a detached shell
  • Next by Date: Re: NSSplitView Question
  • Previous by thread: Re: pointers in objective-c?
  • Next by thread: Re: Distributed Objects "connection went invalid while waiting for a reply"
  • Index(es):
    • Date
    • Thread