views:

70

answers:

2

if your app use this solution , do do you plan port the app to other platform ? for example, iPhone app --> Android or Backberry.

I do not want user it , but some code is exist ...

A: 

I have used both KVC (key value coding) and KVO (key value observing) in applications in the past and find it to be a very useful feature of cocoa (and cocoa touch). It does create some challenges for porting, however I do not have any plans to port to Blackberry or Android at the moment.

Kevin Sylvestre
+1  A: 

Any Cocoa code is not going to be easily portable to Android or Blackberry, regardless of whether or not you use KVC or KVO, since Objective-C doesn't exist on those platforms. If you want a cross-platform app, your best bet is to write basic underlying code (such as data models) in C or C++ and write the GUI in Cocoa.

eman
hi, no, I meaning is that KVC/KVO is not exist in Java ... I know Object c is different to other language, but that most is the same theory, obviously, KVC/KVO does not exist in java ... if a app framework does not use KVC/KVO or other special mechanism , then I think that I just need translate the object c to other language with the same algorithm ...
Robin
Oh, I see what you mean. It's true that KVO has no real equivalent in Java, although KVC does--see [http://stackoverflow.com/questions/1604141/key-value-coding-for-java]. In general, there a quite a few fundamental Objective-C concepts and patterns that don't have direct equivalents in Java (and vice versa), such as delegation, target/action, etc.
eman
ok, thanks for your time anyway.
Robin