• 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: Accessing array in thread safe way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing array in thread safe way


  • Subject: Re: Accessing array in thread safe way
  • From: CoGe - Tamas Nagy <email@hidden>
  • Date: Thu, 08 Mar 2012 21:36:33 +0100

Thanks for the explanation, you are absolutely right!

Tamas

On Mar 8, 2012, at 9:32 PM, Charles Srstka wrote:

> On Mar 8, 2012, at 2:18 PM, CoGe - Tamas Nagy wrote:
>
>> I should subclass NSMutableArray because I had a project which used NSMutableArray (calls) before, but was not thread safe. Anyway, I can't really understand why it would be _really_ better to implement just accessors, but maybe you could explain it a bit more?
>
> Same reason you wouldn’t implement a “name” property as a NSMutableString — encapsulation, an important concept in object-oriented programming. Your object should be the only object that directly manipulates its internal data. You end up with a much more flexible design this way, for a lot of the reasons I already mentioned.
>
> Charles
>




_______________________________________________

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: 
 >Accessing array in thread safe way (From: "Jan E. Schotsman" <email@hidden>)
 >Re: Accessing array in thread safe way (From: Charles Srstka <email@hidden>)
 >Re: Accessing array in thread safe way (From: "Jan E. Schotsman" <email@hidden>)
 >Re: Accessing array in thread safe way (From: CoGe - Tamas Nagy <email@hidden>)
 >Re: Accessing array in thread safe way (From: Charles Srstka <email@hidden>)
 >Re: Accessing array in thread safe way (From: CoGe - Tamas Nagy <email@hidden>)
 >Re: Accessing array in thread safe way (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: Accessing array in thread safe way
  • Next by Date: Re: ivar access during -finalize
  • Previous by thread: Re: Accessing array in thread safe way
  • Next by thread: Re: Accessing array in thread safe way
  • Index(es):
    • Date
    • Thread