Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS - UIToolbar not working in h file
    text
    copied!<p>I am new to developing iOS apps. I am currently making an app which changes nib files.</p> <p>However, after creating a new UIViewController subclass, with a XIB user interface, I cannot get the UIToolbar IBOutlet to work.</p> <p>It may sound silly but the "UIToolbar" dosen't go pink/purple in the header file (.h):</p> <pre><code>@property (nonatomic, retain) IBOutlet UIToolbar *toolbar; </code></pre> <p>Nor does the "_toolbar", go blue/green, in the .m:</p> <pre><code>@synthesize toolbar = _toolbar; </code></pre> <p>This is causing me issue to use the UIToolbar.</p> <p>Here is my code for the .h:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface pedestrians : UIViewController; @property (nonatomic, retain) IBOutlet UIToolbar *toolbar; @end </code></pre> <p>And for the .m:</p> <pre><code>#import "pedestrians.h" @implementation pedestrians @synthesize toolbar = _toolbar; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; } @end </code></pre> <p>Any help would be great. Thanks.</p> <p>EDIT:</p> <p>Just tried to add a UIBar Button like this (not picking up any UI stuff): <img src="https://i.stack.imgur.com/BMlLI.png" alt=".m"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload