PDA

View Full Version : how do i add rbsplitview?




Chirone
Apr 23, 2009, 08:56 PM
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


- The recommended way:
- Include the entire RBSplitView project as a subproject in your own project

- 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:
- Add the libRBSplitView.a static library to the appropriate target

- i drag and dropped that into the project (put it into the frameworks folder, no idea where you drop it in)
- Add the libRBSplitView.a static library as a dependency in your target

- 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
- Add the RBSplitView’s project “source” folder to your user headers search path.

- 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
- include the prebuilt libRBSplitView.a static library into your project (be sure to use the Release version), as well as the RBSplitView/RBSplitSubview.h files, or

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

- include the RBSplitView/RBSplitSubview.h and .m files, as well as the RBSplitViewPrivateDefines.h file, in your project (not really recommended), or

this resulted in lots of compile errors (same as above)

- include the prebuilt RBSplitView.framework framework into your project (only if you really like frameworks; I don‘t). The framework is meant to be included within applications, it’s not set up to work in the standard /Frameworks folders.

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:



kainjow
Apr 24, 2009, 09:41 AM
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.

Catfish_Man
Apr 24, 2009, 10:51 AM
- 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:


You didn't add a target for it.

Chirone
Apr 26, 2009, 05:08 PM
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 :(

You didn't add a target for it.

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

Catfish_Man
Apr 26, 2009, 05:40 PM
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.

Chirone
Apr 26, 2009, 08:57 PM
right, i found this

http://www.codingventures.com/2009/04/xcode-templates-for-iphone-static-libraries-with-unit-testing/

and it seems to work...

thanks catfish_man and kainjow :)

Chirone
Apr 26, 2009, 09:09 PM
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

kainjow
Apr 26, 2009, 11:58 PM
kainjow: there are 5...:(
Ah right, my bad.

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

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:
// .h
IBOutlet RBSplitView *splitView;
IBOutlet RBSplitSubview *view1, *view2;

// .m
[splitView addSubview:view1];
[splitView addSubview:view2];

Chirone
Apr 27, 2009, 07:39 PM
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?

kainjow
Apr 27, 2009, 07:43 PM
You mean the subviews of the splitview don't resize when the splitview itself resizes?

Calling removeFromSuperview should work like normal.

Chirone
Apr 27, 2009, 07:59 PM
You mean the subviews of the splitview don't resize when the splitview itself resizes?
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:
[[rbSplit subviewAtPosition: i] removeFromSuperview];

there needs to be a smilie that has it's face in its palm...