aboutsummaryrefslogtreecommitdiffstats
path: root/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m')
-rw-r--r--examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m13
1 files changed, 3 insertions, 10 deletions
diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m b/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m
index ebac52dcd..fe8afba09 100644
--- a/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m
+++ b/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m
@@ -49,20 +49,13 @@
return self;
}
-- (void)dealloc
-{
- [_detailViewController release];
- [_objects release];
- [super dealloc];
-}
-
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.navigationItem.leftBarButtonItem = self.editButtonItem;
- UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)] autorelease];
+ UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
self.navigationItem.rightBarButtonItem = addButton;
}
@@ -101,7 +94,7 @@
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
@@ -150,7 +143,7 @@
NSDate *object = [_objects objectAtIndex:indexPath.row];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
if (!self.detailViewController) {
- self.detailViewController = [[[DetailViewController alloc] initWithNibName:@"DetailViewController_iPhone" bundle:nil] autorelease];
+ self.detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController_iPhone" bundle:nil];
}
self.detailViewController.detailItem = object;
[self.navigationController pushViewController:self.detailViewController animated:YES];