So I’ve a button with a IBAction heading to another ViewController by its initWithNibName method. Everything is embedded in a NavigationController.
I also created a .xib for this ViewController, here is a quick screenshot :

Here is my code :
.h
@interface ModeEmploiController : UIViewController
{
IBOutlet UIScrollView *scrollView;
UITextView *vueOffres, *vueInfos, *vueGrilles;
}
@property (nonatomic, retain) IBOutlet UIScrollView *scrollView;
.m
@implementation ModeEmploiController
@synthesize scrollView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self)
{
[scrollView setScrollEnabled:YES];
[scrollView setContentSize:CGSizeMake(320, 529)];
// Here I define vueOffres, vueInfos and vueGrilles and for each of them :
[self.view addSubview:vueGrilles/vueInfos/vueOffres];
}
}
But when I run my app, my scroll isn’t enabled and I don’t have the navigation bar of my navigation controller. What’s happening?
Remove your
ModeEmploiControllerfromxib, but keep its childViewandScrollView.now click on
File's Ownerand putModeEmploiControllerfrom Identity inspector in right panel.Now right click on
File's Ownerand connect property ofviewtoViewandscrollViewtoScrollView.