The only way I can see that being possible is with pDic being mutable and 
concurrently accessed in more than one thread.  For the code as below it should 
never happen.

Chuck


On Sep 16, 2010, at 7:34 AM, ISHIMOTO Ken wrote:

> Hi all, was a nice WOWODC, and really nice Job done Pascal.
> 
> 
> 
> I have a small Problem about NSDictionary.
> 
>               NSArray<Movie> movies= 
> Movie.fetchAllMovies(defaultEditingContext());
>               EOEnterpriseObject eo = movies.objectAtIndex(0);
>               NSDictionary pDic = 
> EOUtilities.primaryKeyForObject(defaultEditingContext(), eo);
>               System.err.println("1:" + pDic); -->1:{movieID = 102; }
>               System.err.println("isEmpty:" + pDic.isEmpty()); -->isEmpty:true
>               System.err.println("count:" + pDic.count()); -->count:1
> 
> 
> Hadn't isEmpty not to be false ?
> 
> Also looking into isEmpty 
> 
>       public int count() {
>               return _count;
>       }
> 
>       public boolean isEmpty() {
>               System.err.println("_count : " + _count); -->_count : 0
>               System.err.println("count() : " + count()); -->count : 1
>               
>               return _count <= 0;
>       }
> 
> 
> Why is the result of _count and count() different?
> 
> Any ideas what's going wrong?
> 
> 
> 
> 
> 
> 
> Thank you
> 
> --------------------------------------------------------
> K's ROOM      (ISHIMOTO Ken)
> --------------------------------------------------------
> [E-Mail]  <[email protected]>
> [iChat:]   <[email protected]>
> [HP]          http://www.ksroom.com/
> _____________________________________________________________________
> This e-mail has not been scanned for viruses because it was written on an Mac,
> and there are NO Viruses on an Apple Computer.
> For further information visit http://www.apple.com
> 
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
> 
> This email sent to [email protected]

-- 
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.    
http://www.global-village.net/products/practical_webobjects







Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to