From: Gergely K. <ger...@ma...> - 2010-03-29 06:48:54
|
Hi, 2010/3/27 Panayotis Katsaloulis <pan...@pa...> > > On 26 Μαρ 2010, at 8:07 μ.μ., Gergely Kis wrote: > > > Actually we did something very similar with the "synchronized" > implementation. > > We needed to store locks for each method somewhere, and created something > called "XMLVMRegistry" which stores the locks for each object that uses > them. > > > I am trying to have a look at it, but I can't find it. > Is it possible to tell me where it is? > From what you describe though, it looks like we have implemented the same > thing. > http://xmlvm-reviews.appspot.com/18002/patch/1/33 > > Still, I think I found a better and more elegant solution: the use of > associations, which are new in 10.6 and in iPhone SDK 3.1 > (this shouldn't be a problem, right?) > > Documentation can be found here: > > http://17.254.2.129/iphone/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocAssociativeReferences.html I think this is a nice, elegant solution, and we should migrate to it. Personally I don't see a problem with only supporting iPhone 3.1+, with 3.2 around the corner. > > > The only problem is that this framework is missing from the emulator! > So the code does not even compile for the emulator? Maybe then we should create a very simple dummy implementation. Did you check with the 3.2 beta SDK? Maybe this will all go away when we upgrade to it. > Since we are going to use it only in one specific location (retaining an > object when is given as a delegate for example), and since emulator does > not suffer from strict memory problems, I believe up to the day this bug > will be fixed in the simulation (there is already a bug report for that) we > can "ignore" this memory leak under simulator, since it works fine in > iPhone. > > What do you think? > I think we should not reinvent wheels, which are already in the platform. Maybe we could introduce a few generic macros to make the code more readable. The use of macros also enables those who have to support older SDKs to replace it with their own implementations. Best Regards, Gergely -- Kis Gergely MattaKis Consulting Email: ger...@ma... Web: http://www.mattakis.com Phone: +36 70 408 1723 Fax: +36 27 998 622 |