Posts Tagged ‘tutorial’

UIBarButtonItem – Programmatically

Wednesday, October 12th, 2011

There is a great tutorial on how to programmatically create and customized the UINavigationController (including UIBarButtonItem) here.

One issue I had was while Adding items to the right of your Navigation Bar. A bar button item is created like so:


UIBarButtonItem *myButton = [[UIBarButtonItem alloc] initWithTitle@"My Button" style:UIBarButtonItemStyleBordered target:self action:@selector(doSomething)];
self.navigationItem.rightBarButtonItem = myButton;
[myButton release];

The doSomething above, is a method and it looks like this:


- (IBAction)doSomething:(id)sender
{
NSLog(@"%@", @"My Button was pressed");
}

You might expect this to work, however, when the button is pressed the program will crash with an unrecognized selector error. This is because the signature of the doSomething method has a colon on the end of it: doSomething:

Therefore, the code for creating the UIBarButtonItem should be:


UIBarButtonItem *myButton = [[UIBarButtonItem alloc] initWithTitle@"My Button" style:UIBarButtonItemStyleBordered target:self action:@selector(doSomething:)];
self.navigationItem.rightBarButtonItem = myButton;
[myButton release];

iPad 101 – How to Increase Text Size

Sunday, September 25th, 2011

Reading e-mail in the Mail app can really strain the eyes if you suffer from poor eye-sight. The iPad has built-in accessibility features, which enable the text size to be increased. Increasing the text size is the topic of the first of my iPad 101 tutorials. The tutorials are hosted on my RWH Technology site. Click here to read the tutorial.