Take the 2-minute tour ×

Please see the image below. Keep in mind I am using xcode 4.5.2 as well. I followed the example on JASidePanels from github Example #2 and I can't seem to get rid of this black box! Otherwise the SidePanel actually works as expected. =)

image of problem

My centerViewController and leftViewController also look the same (code below). But when I tried to do it like the example said to do it, I wasn't having any such luck, so I had to subclass the JASidePanelController:


#import "JASidePanelController.h"

@interface centerViewController : JASidePanelController



#import "centerViewController.h"

@interface centerViewController ()


@implementation centerViewController

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    return self;

- (void)viewDidLoad
    [super viewDidLoad];
    // Do any additional setup after loading the view.

- (void)didReceiveMemoryWarning
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.


Could I very well be missing something? I have commented out a few lines of code to remove the rightViewController on the main JASidePanelController itself, thinking that could be causing a problem and it just caused more issues. I don't have the code for the rightViewController from the example as I am just using the left and center. So I set the code back into its defaults and I am left with a black box over the app in my simulator.

Thanks in advance!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Don't inherit from JASidePanelController for your center view controller. Think of a JASidePanelController as a container view that can hold 3 view controllers. Here is an example from my AppDelegate one of my projects:

self.panelController = [[JASidePanelController alloc] init];

UIViewController *centerViewController = [storyboard instantiateInitialViewController];
self.panelController.centerPanel = centerViewController;
self.panelController.delegate = centerViewController;
self.panelController.rightPanel = [[DBRightViewController alloc] init];
self.panelController.leftPanel = [[DBLeftViewController alloc] init];

Think of it this way, you need a single JASidePanelViewController, which will hold your other view controllers. This can be a subclass of JASidePanelViewController, but it is probably not needed so long as you store the reference to it somewhere. In my example I store the panelController as a property in my AppDelegate.

Then, each of your viewcontrollers will be subclasses of UIViewController.

share|improve this answer
I thought that you were supposed to inherit from everything using the #import function, or atleast that is how I understood it anyway. Now are you putting that in the JASidePanelController files or are you doing that in the centerViewController itself? This is a great example, I am sorry I don't quite get it! But if you could expand on it I might get it...sorry and thank you so much! –  Chris Hickey Mar 18 '13 at 1:42
Updated my answer, hopefully helps a bit more. –  danielbeard Mar 18 '13 at 1:49
Ok...I think I get it now! So I am going to assume that you throw this in the AppDelegate.m then? I have to admit this is my first iOS app, just sort of playing around trying to learn. This particular implementation and the documentation aren't overly clear as to what goes where, so I am learning by trial and error. –  Chris Hickey Mar 18 '13 at 2:00
Yes, if you wanted this to be your root view controller. –  danielbeard Mar 18 '13 at 2:02
Thanks so much, I appreciate it! I am going to keep playing with it and see where it gets me. –  Chris Hickey Mar 18 '13 at 2:07
show 3 more comments

Your Answer


