Re: Design Question
Fair enough. I guess what I'm wondering then is how do I handle the following case. I have several loosely coupled properties which can read somewhat like this. (ProjectInstall *)projectInstall { return [ProjectInstallController projectInstallWithProjectId:projectId]; } And in some cases it's completely legit for the loose coupled properties to return nil What's the right way for this property to be KVO/KVC compliant? I really do like bindings and believe that it's absolutely possible to get it done right I'm just trying to figure it out. Thanks for the input, Bryan McLemore Kaelten On Thu, Aug 6, 2009 at 12:35 AM, Quincey Morrisquinceymor...@earthlink.net wrote: On Aug 4, 2009, at 11:35, Kaelten wrote: I have an application I'm working on where I'm using mainly Bindings for communicating with the UI, but I find myself in situations where I'm not getting all the data updates to the UI. These lack of updates seem to stem either from dependent keys, loose coupling between objects, to-many relationships, and nullable relationships. I work around the first one mostly with setKeys:triggerChangeNotificationsForDependentKey: (I'm targeting 10.4). It's the other three cases that I'm having a slight issue with. One thought I had is that I could craft notifications so that the loosely coupled objects and nullable relationships can listen for something that'd cause them to need to update. It's all about KVO compliance. If you update your data model KVO-compliantly, then its observers (e.g. the user interface) will notice the changes. The documentation isn't very clear, but the granularity of KVO compliance isn't obvious. An *object* (an instance) is KVO-compliant for a *property* (a string name) or its not. Typically, all objects of a class have the same KVO-compliance for their properties, due their shared class implementation, so it's reasonable to talk about the KVO compliance of a class for a given property. If you have a lot of properties, you have a lot of compliance issues to deal with. So, it's not an issue of loose couplings, or to-many relationships or nullable relationships -- they'll all work fine if the corresponding properties are updated KVO-compliantly, and that has to be taken on a case-by-case basis. Sorry. If you want ask specifically about certain of the malfunctioning properties, you might get answers you can adapt to the others. I just don't think there's a general answer, except that it really does work, if you Do It Right(tm). ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/kaelten%40gmail.com This email sent to kael...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [iPhone] networking
Just brainstorming theory here, but it might be made much easier if you had a server act as an intermediary, even if all that server does is 'introduce' the two iphones to each other. Bryan McLemore Kaelten On Tue, Aug 4, 2009 at 1:10 PM, James Linjamesclin...@gmail.com wrote: Correct me if I am wrong...but from what i have read so far... Bonjour is for local area network, right? What I am trying to do is to get 2 iPhones located in 2 different part of the world to connect to each other on the internet. Can Bonjour work? Thanx in advance... James On 2009/8/5, at 上午 2:02, glenn andreas wrote: On Aug 4, 2009, at 12:49 PM, James Lin wrote: I am trying to make the iPhone a server and a client at the same time... What I am trying to accomplish... 1. iPhone running my application opens a server socket and listens for incoming network connection from another iPhone running the same application. 2. The server socket has an ip address that i can register with my php/mysql server. 3. Another iPhone running my same app acts as the client gets the iPhone server's ip address from the server and make connection to the server iPhone. 4. The client iPhone sends a string hello, I am James to the server iPhone and the server iPhone reply with the user's choice of either Hi, Nice to meet you or Get lost! strings. Unless the two phones are on the same local WiFi network, due to the way that various NATs (especially with cell phone networking), a client will almost certainly not be able to connect to a server running on the phone. Basically, the phone see only a local (private) network, and will have an address such as 10.3.5.12. Unfortunately, that IP address is meaningless outside of local network (there is no way for a remote phone, which may have the exact same address, to find 10.3.5.12 as being your local phone). Given that trying to support phone based servers isn't going to work except for within the same WiFi network, you might as well instead use Bonjour for one phone to discover the other phone (which will automatically handle finding/resolving/advertising ip address/ports). Glenn Andreas gandr...@gandreas.com http://www.gandreas.com/ wicked fun! Mad, Bad, and Dangerous to Know ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/kaelten%40gmail.com This email sent to kael...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Design Question
I have an application I'm working on where I'm using mainly Bindings for communicating with the UI, but I find myself in situations where I'm not getting all the data updates to the UI. These lack of updates seem to stem either from dependent keys, loose coupling between objects, to-many relationships, and nullable relationships. I work around the first one mostly with setKeys:triggerChangeNotificationsForDependentKey: (I'm targeting 10.4). It's the other three cases that I'm having a slight issue with. One thought I had is that I could craft notifications so that the loosely coupled objects and nullable relationships can listen for something that'd cause them to need to update. Unfortunately, this is my first cocoa application and I'm working in a fairly sizable vacuum so any input you guys have would be greatly appreciated. Bryan McLemore Kaelten ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com