From: Panayotis K. <pan...@pa...> - 2010-09-11 10:19:17
|
Well, you are the boss, but I I don't see the problem on using reflection. And in some situations, we can't avoid it at all (like the important selector "performSelectorOnMainThread") Now, about the other problem of optional selectors, I believe I gave a nice solution with org.xmlvm.iphone.internal.OptionalSelectorException. Of course, the emulator should follow some guidelines, but in any case I believe it is an elegant solution In both cases, the API was completely compatible with Java and ObjC at the same time :) -- Panayotis 11 Σεπ 2010, 12:42 μ.μ., ο/η Arno Puder <ar...@pu...> έγραψε: > > just to explain that change: NSTimer in Objective-C allows to trigger > arbitrary methods. This is easy in Objective-C since this language is > dynamically typed. So far we mimicked this in Java by using reflection. > However, Java is a strongly typed language and doing it this way is not > in the spirit of the language. That is why we introduced NSTimerDelegate. > > Note that at some point we need to make design decisions where we cannot > easily map Objective-C to Java (another example are optional methods in > Objective-C protocols. Here we also deviate from the "official Apple > documentation"). Its a design decision but I believe its a good one. > > Arno > |