[Pyobjc-dev] Object not being identified correctly?
Brought to you by:
ronaldoussoren
From: Sean G. <pr...@cf...> - 2003-05-26 00:18:42
|
Hello all, I am using an NSOutlineView to display a hierarchy of data, so Cocoa asks for items, and then later gives them back to me, looking for the number of children, and "value" ("label") for the data, which it draws onto the UI. My problem is that, when Cocoa gives the item back to me, the "in" test fails. Take a look at the following code "snippet," and its results: def outlineView_isItemExpandable_( self, outlineView, item ): NSLog( "isItemExpandable: %s" % ( item ) ) NSLog( "item in self.profiles: %s" % ( item in self.profiles ) ) for profile in self.profiles: NSLog( "%s" % ( profile ) ) Results: 2003-05-25 20:09:04.427 Bluebeard2[5819] isItemExpandable: <ServerInformation.ServerInformation instance at 0x8cfac0> 2003-05-25 20:09:04.429 Bluebeard2[5819] item in self.profiles: 0 2003-05-25 20:09:04.431 Bluebeard2[5819] <ServerInformation.ServerInformation instance at 0x8cfac0> As you can see, the objects share the same reference address. Performing similar actions in the Python interpreter works fine ("in" tests return True). I've also tried, in the "for profile in profiles:" loop, "==" and "is" tests, which both return False. Can anyone shed some light onto why this is happening? Thanks, Sean |