zoukankan      html  css  js  c++  java
  • Note_Master-Detail Application(iOS template)_07_ YJYDetailViewController.m

    //  YJYDetailViewController.m

    #import "YJYDetailViewController.h"

    @interfaceYJYDetailViewController ()

    @property (strong, nonatomic) UIPopoverController *masterPopoverController;

    - (void)configureView;

    @end

    @implementation YJYDetailViewController

    #pragma mark - Managing the detail item

    - (void)setDetailItem:(id)newDetailItem

    {

        if (_detailItem != newDetailItem) {

            _detailItem = newDetailItem;

            

            // Update the view.

            [selfconfigureView];

        }

        if (self.masterPopoverController != nil) {

            [self.masterPopoverControllerdismissPopoverAnimated:YES];

        }        

    }

    - (void)configureView

    {

        // Update the user interface for the detail item.

        if (self.detailItem) {

            self.detailDescriptionLabel.text = [[self.detailItemvalueForKey:@"timeStamp"] description];

        }

    }

    - (void)viewDidLoad

    {

        [superviewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.

        [selfconfigureView];

    }

    - (void)didReceiveMemoryWarning

    {

        [superdidReceiveMemoryWarning];

        // Dispose of any resources that can be recreated.

    }

    #pragma mark - Split view

    - (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController

    {

        barButtonItem.title = NSLocalizedString(@"Master", @"Master");

        [self.navigationItemsetLeftBarButtonItem:barButtonItem animated:YES];

        self.masterPopoverController = popoverController;

    }

    - (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem

    {

        // Called when the view is shown again in the split view, invalidating the button and popover controller.

        // 隐藏导航栏左边的按钮

        [self.navigationItemsetLeftBarButtonItem:nilanimated:YES];

        self.masterPopoverController = nil;

    }

    @end

  • 相关阅读:
    golang html/template template.ParseFiles(filenames) 相对路径问题
    深入理解jvm jdk1,7(19)
    深入理解jvm jdk1,7(18)
    深入理解jvm jdk1,7(17)
    深入理解jvm jdk1,7(16)
    深入理解jvm jdk1,7(15)
    深入理解jvm jdk1,7(14)
    hugo 制作个人博客总结
    后台管理系统总结
    pageHelper(分页插件的使用)
  • 原文地址:https://www.cnblogs.com/allearner/p/3623116.html
Copyright © 2011-2022 走看看