• 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: NSDictionary.isEmpty
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDictionary.isEmpty


  • Subject: Re: NSDictionary.isEmpty
  • From: Mike Schrag <email@hidden>
  • Date: Thu, 16 Sep 2010 13:10:17 -0400

Yeah it was a subtle hint that he was lying to us :)

But Mark tracked it down.

ms

On Sep 16, 2010, at 1:00 PM, Alan Ward wrote:


I don't even see how a race condition could cause that as both the variable and the method are accessed several times 
during the course of printing his debug output and [he claims] they both have differing but consistent values. Bizarre.

Alan

On Sep 16, 2010, at 10:55 AM, Mike Schrag wrote:

are you .... sure? are you using the same version of NSDictionary that is in wonder trunk? that's impossible, basically, unless that dictionary is being attacked by multiple threads and you'e in the middle of a race condition .......

On Sep 16, 2010, at 10: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@hidden>
[iChat:]   <email@hidden>
[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@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSDictionary.isEmpty (From: ISHIMOTO Ken <email@hidden>)
 >Re: NSDictionary.isEmpty (From: Mike Schrag <email@hidden>)
 >Re: NSDictionary.isEmpty (From: Alan Ward <email@hidden>)

  • Prev by Date: Re: NSDictionary.isEmpty
  • Next by Date: Re: NSDictionary.isEmpty
  • Previous by thread: Re: NSDictionary.isEmpty
  • Next by thread: Re: NSDictionary.isEmpty
  • Index(es):
    • Date
    • Thread