Skip to content

Instantly share code, notes, and snippets.

@bmulholland
Created October 23, 2012 21:14
Show Gist options
  • Save bmulholland/3941620 to your computer and use it in GitHub Desktop.
Save bmulholland/3941620 to your computer and use it in GitHub Desktop.
//
// ViewController.m
// Test
//
// Created by Brendan Mulholland on 2012-10-23.
// Copyright (c) 2012 Brendan Mulholland. All rights reserved.
//
#import "ViewController.h"
#import "AppDelegate.h"
#import "TextCell.h"
@interface ViewController ()
@end
@implementation ViewController
- (id)init {
if (self = [super initWithStyle:UITableViewStyleGrouped]) {
self.navigationItem.title = @"Title";
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Title"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(nextStep)];
}
return self;
}
- (void)nextStep
{
[self.navigationController pushViewController:[[ViewController alloc] init] animated:YES];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
return [[TextCell alloc] init];
}
@end
//
// TextCell.m
// Test
//
// Created by Brendan Mulholland on 2012-10-23.
// Copyright (c) 2012 Brendan Mulholland. All rights reserved.
//
#import "TextCell.h"
@implementation TextCell
- (id)init
{
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
if (self) {
UITextField* test = [[UITextField alloc] init];
[test becomeFirstResponder];
self.accessoryView = test;
}
return self;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment