how do i add rbsplitview?

Discussion in 'Mac Programming' started by Chirone, Apr 23, 2009.

  1. Chirone macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #1
    this is probably a stupid question but how do i add it?
    the RBSplitview shows up in IB fine and functional

    the only thing is, i can't get it to work with xcode

    - done that (i think), i just drag and dropped the project file into my project and it appeared there. i dont know what the point of doing this is though, it doesn't seem to be functional :confused:
    - i drag and dropped that into the project (put it into the frameworks folder, no idea where you drop it in)
    - i thought this happens automatically when you drop new things into your project? i think i'm missing something, i don't quite understand what this is saying, or the step before
    - dropped that in, and when i compiled it complained with 16 compile errors saying there are syntax errors before typeof

    so thought i'd try the non-recommended ways of doing it
    i put the libRBSplitView.a and the two header files into the Other Sources folder of my project and then my program crashes on start up
    this resulted in lots of compile errors (same as above)
    my program exits with code 5 (i don't know what that means)

    sorry for asking this when you guys probably think this is really obvious, but to me it's not...

    i have tried recompiling the rbsplitview project and using those do nothing
    the palette compiles with the error "Command /Developer/usr/bin/gcc-4.0 failed with exit code 1"

    however the sample.app that comes with the download works fine :confused:
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    There should be only two files for the class (the .h and .m). I'd just add both directly to your project.

    I didn't use the IB palette when I used it. I just created a custom view, set it to RBSplitView, setup an outlet and configured it in code.
     
  3. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #3

    You didn't add a target for it.
     
  4. Chirone thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #4
    kainjow: there are 5...
    RBSplitView.h and .m
    RBSplitSubView.h and .m
    and RBSplitViewConstants.h
    and in any case, just adding them won't get around the compile errors :(

    how do i do that?
    when i drag and dropped it comes up with the shelf with the option to add it to the targets, and they are ticked
    they were ticked for everything whenever i added anything in
     
  5. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #5
    Right click in the "targets" section in the sidebar and choose "add new target". You'll need to set it up though... I would recommend reading the Xcode documentation for how to do that.
     
  6. Chirone thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
  7. Chirone thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #7
    kainjow (or anyone else), how did you programatically add stuff to the RBSplitSubview?

    like if i want to programatically add scroll views

    i ask because NSView's setSubViews: doesn't seem to work and there is nothing in the documentation that says i should be using something else
     
  8. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #8
    Ah right, my bad.

    Each of the subviews in the split view need to be RBSplitSubview, so I created two top-level views of this class in my nib (and added controls to them) and then did this:
    Code:
    // .h
    IBOutlet RBSplitView *splitView;
    IBOutlet RBSplitSubview *view1, *view2;
    
    // .m
    [splitView addSubview:view1];
    [splitView addSubview:view2];
     
  9. Chirone thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #9
    that works, but the resizing of the other views don't work for some reason, even when all the options in the springs have been enabled...

    also, i can't seem to remove subviews from the RBSplitView... do you know if there is a way of doing this?
     
  10. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #10
    You mean the subviews of the splitview don't resize when the splitview itself resizes?

    Calling removeFromSuperview should work like normal.
     
  11. Chirone thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #11
    hmm nevermind that... that would happen if i'd add the view as a subview of the rbSplitSubView (i was experiementing trying to figure out how to change the view to another one)


    i tried doing removeFromSuperview once before on of the views that was added but the rbsplitview was still left behind.

    oh wait, while typing that i just thought of something...
    the NSViews are embedded into an RBSplitView, i just have to add this line of code in:
    Code:
    [[rbSplit subviewAtPosition: i] removeFromSuperview];
    there needs to be a smilie that has it's face in its palm...
     

Share This Page