Re: [Pyobjc-dev] KVO error on Tiger - what have I not updated?
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2005-05-30 18:34:39
|
Python instances only have one namespace for ivars and methods. Whichever is set last wins. PyObjC will pick up whichever *one* is there. If you had both in the code, the code was wrong.. Maybe you're using KVC to set the "description" key, but you don't have a setDescription_ accessor? -bob On May 30, 2005, at 11:30 AM, Clive Jevons wrote: > Last one :) > The problem with the stories not appearing correctly seems to be in > a difference in the handling of 'description' either in ObjC or the > bridge ... it now actually showed the result of calling the method > 'description' rather than the content of the instance variable > 'description'. The reason I had both in the code is that I'd > originally expected the behaviour I get now (result of method), but > got the content of the instance variable, and forgot to take out my > test code ... but had I not I probably wouldn't have noticed that > this feature (?) is now working correctly (?) ;) > > Cheers, > C > > On 30 May 2005, at 19:58, Bob Ippolito wrote: > > >> Looking at the example I see a couple things: >> >> - Before looking for a particular kind of change dictionary, you >> need to make sure that the change dictionary actually represents >> the kind of change you're looking for.. in particular, it looks >> like you want this check: >> change[NSKeyValueChangeKindKey] == NSKeyValueChangeSetting >> >> - The text encodings are all wrong... utf-8 and latin-1 are not >> equivalent, and in 1.3 the utf-8 string is going to be bridged >> with the default Objecitve-C encoding (macroman) so it's going to >> be even more wrong than if you left it as unicode (leaving it as >> unicode would have correct display, but sometimes would raise an >> exception when you try and generate the sql). You should >> definitely read up on unicode... >> >> - You're using tabs instead of spaces.. ugh. Nearly everyone else >> uses 4-space indent, with no tabs anywhere, I suggest you do the >> same. >> >> So my guess was wrong, the code was always incorrect, it just >> didn't happen to break for you under Panther.. I don't see >> anything here (other than the strings) that would have different >> behavior between PyObjC 1.2 and 1.3.6. You were just lucky that >> you weren't seeing change dictionaries that weren't >> NSKeyValueChangeSetting >> >> -bob >> >> >> On May 30, 2005, at 10:19 AM, Clive Jevons wrote: >> >> >> >>> <newsclient.tgz> >>> >>> ... here's the app that breaks for me. This code also matches the >>> stack trace from earlier. There's an SQL script in there with >>> which you can set up the DB. As before, I've running it on a >>> MySQL database and using MySQLdb to access that. Hit command-, to >>> get the DB preferences up in the app, put in your settings, then >>> OK that and finally command-o to load from the DB. I've got >>> several items in the table already from before I upgraded to >>> Tiger. It loads the first item OK, but bombs out with said >>> exception on the second. >>> Let me know if I've forgotten to include anything :) >>> >>> Thanks again for all your help ;) >>> >>> Cheers, >>> C >>> >>> On 30 May 2005, at 17:42, Bob Ippolito wrote: >>> >>> >>> >>> >>>> >>>> On May 30, 2005, at 7:58 AM, Ronald Oussoren wrote: >>>> >>>> >>>> >>>> >>>> >>>>> >>>>> On Monday, May 30, 2005, at 12:28PM, Clive Jevons >>>>> <cl...@bl...> wrote: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>> Thanks for the answer - what's the best way to check which >>>>>> version of >>>>>> PyObjC is being pulled by the runtime? I've just installed PyObjC >>>>>> 1.3.6 from source and also Python 2.4.1 from source. When I open >>>>>> python from the CLI I can see that its definitely 2.4.1 that's >>>>>> being >>>>>> used ... I removed all pyc and other build artifacts from the >>>>>> project >>>>>> and then performed python setup.py py2app -A ... this should >>>>>> build >>>>>> the app using the python with which it was called, shouldn't >>>>>> it? And >>>>>> given as that python is a clean install on Tiger, the only >>>>>> version of >>>>>> PyObjC which it has should be 1.3.6 which I only just >>>>>> installed. Hrm. ?? >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> What Bob was trying to say is that he changed to Python >>>>> interface to KVO in PyObjC 1.3.5. >>>>> >>>>> Bob, can we add backward compatibility code (with enabled >>>>> warnings) to PyObjC to give users some time to fix their code? >>>>> >>>>> >>>>> >>>>> >>>> >>>> Probably not, I don't even know what the problem is specifically >>>> because we don't have an example that breaks. >>>> >>>> -bob >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> >> >> >> >> > > |