1
/****************************************************************************
3
** Copyright (C) 2013 Petroules Corporation.
4
** Contact: http://www.qt-project.org/legal
6
** This file is part of the Qt Build Suite.
8
** Commercial License Usage
9
** Licensees holding valid commercial Qt licenses may use this file in
10
** accordance with the commercial license agreement provided with the
11
** Software or, alternatively, in accordance with the terms contained in
12
** a written agreement between you and Digia. For licensing terms and
13
** conditions see http://qt.digia.com/licensing. For further information
14
** use the contact form at http://qt.digia.com/contact-us.
16
** GNU Lesser General Public License Usage
17
** Alternatively, this file may be used under the terms of the GNU Lesser
18
** General Public License version 2.1 as published by the Free Software
19
** Foundation and appearing in the file LICENSE.LGPL included in the
20
** packaging of this file. Please review the following information to
21
** ensure the GNU Lesser General Public License version 2.1 requirements
22
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
** In addition, as a special exception, Digia gives you certain additional
25
** rights. These rights are described in the Digia Qt LGPL Exception
26
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
****************************************************************************/
30
#import "DetailViewController.h"
32
@interface DetailViewController ()
33
@property (nonatomic, retain) UIPopoverController *masterPopoverController;
34
- (void)configureView;
37
@implementation DetailViewController
39
@synthesize detailItem = _detailItem;
40
@synthesize detailDescriptionLabel = _detailDescriptionLabel;
41
@synthesize masterPopoverController = _masterPopoverController;
45
[_detailItem release];
46
[_detailDescriptionLabel release];
47
[_masterPopoverController release];
51
#pragma mark - Managing the detail item
53
- (void)setDetailItem:(id)newDetailItem
55
if (_detailItem != newDetailItem) {
56
[_detailItem release];
57
_detailItem = [newDetailItem retain];
63
if (self.masterPopoverController != nil) {
64
[self.masterPopoverController dismissPopoverAnimated:YES];
70
// Update the user interface for the detail item.
72
if (self.detailItem) {
73
self.detailDescriptionLabel.text = [self.detailItem description];
80
// Do any additional setup after loading the view, typically from a nib.
84
- (void)didReceiveMemoryWarning
86
[super didReceiveMemoryWarning];
87
// Dispose of any resources that can be recreated.
90
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
92
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
94
self.title = NSLocalizedString(@"Detail", @"Detail");
99
#pragma mark - Split view
101
- (void)splitViewController:(UISplitViewController *) __unused splitController willHideViewController:(UIViewController *) __unused viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
103
barButtonItem.title = NSLocalizedString(@"Master", @"Master");
104
[self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
105
self.masterPopoverController = popoverController;
108
- (void)splitViewController:(UISplitViewController *) __unused splitController willShowViewController:(UIViewController *) __unused viewController invalidatingBarButtonItem:(UIBarButtonItem *) __unused barButtonItem
110
// Called when the view is shown again in the split view, invalidating the button and popover controller.
111
[self.navigationItem setLeftBarButtonItem:nil animated:YES];
112
self.masterPopoverController = nil;