Bindings - would someone explain what they are?

Discussion in 'iOS Programming' started by glossywhite, Apr 6, 2009.

  1. macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #1
    Hi all!. I'm finding the Obj-C/Cocoa learning curve a little steep, and I find it pretty hard to grasp concepts of OOP. I am mildly autistic, which I think may be something to do with my not being able to absorb things fully at times, but once I grasp concepts I usually rocket up the learning curve.

    If someone would explain to an intelligent, but rather confused n00b to Cocoa, what "bindings" are, bearing in mind that my programming knowledge is rather limited, and I have only JUST grasped the concept of pointers in C/C++ and am willing to learn, as I wish to develop something nice for App Store, soon. I know learning is never overnight (well, usually not) but I have been to IRC channels etc for iPhone/Mac dev, and all I get is rather snooty members telling me to go away, or pointing me to Apple official docs, which just appears to me as if they can't be bothered to encourage me :(.

    If someone would be willing to donate 1/2 hour or so of their time to clear up a bit of confusion I have, I would really be extremely and eternally grateful, as I am EXTREMELY technically minded and highly proficient with all computers, but OOP just seems to blow my mind at times.

    So many thanks, if you can! :D
     
  2. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    Bindings are not supported on iPhone OS so are really not a topic for discussion on this forum.

    Bindings aren't a beginners topic so you might want to wait a while before learning about them. Obviously the way to start reading about them is to read the Apple docs, as apparently others have told you. You could also subscribe to cocoa-dev or Google Cocoa Bindings for lots of info.
     
  3. macrumors member

    Joined:
    Jul 28, 2008
    #3
    The point of bindings is to be able to link your models and views without efforts. It builds on KVC and KVO so you also need some understanding of these topics.

    Bindings are basically a good implementation of the Observer pattern which is fairly common in OOP. You can probably google that around and find a much better and in-depth discussion that what I could ever explain in a few minutes.

    With Bindings, you basically tell the view to "observe" the model and update it's representation every time it is changed, but also to update the model when the view is changed by the user. For example if you had a model with a "Sound Volume" property, you could have a slider bounds to that property so that the model is updated whenever you touch the slider, but the slider would also update if you changed the model by other means (e.g. hitting Vol+/Vol- on your keyboard, but that's just to make it more explicit and this example is probably not very well chosen).

    Anyway bindings are not supported on iPhone OS (at least not yet). Not sure exactly why, as we are seeing CoreData coming to the iPhone and I thought bindings were introduced in Mac OS before CoreData :rolleyes:
    So you can basically try to tinker with it on Mac OS, have some fun since it's a good technology imho ... but you won't make anything out of it on iPhone OS.
     
  4. thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #4
    Ahh okay :) thanks for taking the time to try and explain to me (it did and does make sense now!). See, the post before yours is the kinda reply I have been getting, just brushing me off which isn't very helpful to me, instead of actually saying "no, I'm gonna help this guy out, no matter if it's not applicable, because it's what he's struggling with, regardless of the fact that maybe it was the wrong forum to ask in". The fact that bindings are not yet applicable on the iPhone is not something I would have known about until now, but just passing the buck seems to be something that those in the know, tend to do a lot, as IRC channels have taught me.

    How can we learn, if those with the knowledge are never willing to break off for a bit, and take the time to explain?. Web pages and PDFs are all very well, but you can't beat the one-to-one, human approach sometimes. I have a lot of knowledge, and if I think it can help someone's learning curve, then I'm usually delighted to impart this to them, in order to make a better world.

    "Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime."

    Thankyou for taking the time - I'd buy you dinner if you were here.
     
  5. macrumors 6502a

    Joined:
    Oct 29, 2006
    Location:
    Virginia
    #5
    I think the moderators would have a hard time of it if people were just free to ask questions in whatever forum regardless of relevance. Why not just ask a mod to move your question if you made a mistake?

    Oh, there are a lot of people here who are very helpful actually. This is easily one of the better set of forums for that. Lots of real experts here who aren't talking out of their you-know-what's. :) That's rare.
     
  6. macrumors 6502a

    Joined:
    Oct 29, 2006
    Location:
    Virginia
    #6
  7. thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #7
    Thanks, eddietr - I actually happened across that earlier :). I just found a VERY useful page in Hillegass' book "Cocoa programming for Mac OS X":

    I couldn't have said it better myself - this is PRECISELY how I feel and think at times - and I am a certified electronics engineer - FAR from stupid! :D
     
  8. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #8
    You're not really going to tell us that reading those couple paragraphs by Taum has given you a good understanding of bindings are you?

    I doubt that you have a clue what KVO, KVC, and the Observer pattern are.

    I find it impossible to understand why you think that those couple paragraphs are better, for some definition of better, than the 'What are Cocoa Bindings' chapter in Apple's documentation, which will take you a half hour to read and took the authors more than five minutes to write.

    You may call me snooty but I don't believe that you know one whit more about bindings now than you did before you read Taum's post.
     
  9. thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #9
    Actually yes - he has explained VERY clearly what the basis of bindings is. Some people instinctively get to the point, and no - he hasn't covered all bases, BUT he HAS given me a very firm grounding on which to build, clarify and work on this, using a process of elimination. Don't underestimate the autistic person's mind - we don't think like the average person! :D

    I don't mean to be rude, but have you noticed something here; taum wrote ONE post, and taught me something immediately. You have written TWO replies, both of which have taught me nothing apart from that you're more ready to point me elsewhere than actually take time to TRY and explain, no matter how basic and irrelevant YOU may personally feel it would be to me. Can't tell you why, but taums words just sank in - clicked instantly, the very basic idea of what bindings are. Please don't deride other people's efforts to educate, unless you have a better way of making the same point?.

    The personal touch counts for a LOT - maybe it's the fact he took the time to TRY and teach me, no matter how vague and minimal his information was (it was very concise, tbh).

    Thanks.
     

Share This Page