`
lihao312
  • 浏览: 479892 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

IOS基础知识记录四(Master-Detail Application)

阅读更多
1.在创建主-从视图的应用程序时,Master-Detail Application无疑是一个良好的想法,
它结和表视图和详细视图,而且还能调整内容的大小。 主要还能在ipad和iphone上面跑起来
不过在ipad上面用到是弹出层(竖屏)

2.在使用xcode 4.5,ios6时,一些基本重要的方法都自动生成,只需要你填入适当的数据即可
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{//在该方法中部分功能已实现
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];

      cell.textLabel.text=@"title"// 你需要处理标题 还有付标题 以及image
      return cell;
}

//切换时调用方法也生成了,在该方法中可以设置在详细视图中显示的值
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender


3.在DetailViewController中实现代码
- (void)configureView
{
    // Update the user interface for the detail item.

    if (self.detailItem) {
        //self.detailDescriptionLabel.text = [self.detailItem description];
        //你预在详细页面显示的内容
    }
}



4. 在MasterViewController里面 还增加两个默认的编辑按钮和删除按钮。
- (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:)];
   self.navigationItem.rightBarButtonItem = addButton;
}
分享到:
评论

相关推荐

    IOs 5编程入门经典

    ◆ 介绍了iOS 5编程的基础知识 ◆ 介绍如何响应及处理设备旋转以及不同类型的屏幕方向 ◆ 展示如何使用Tabbed、Master-Detail、Single View和Utility等 各种应用程序模板 ◆ 探讨在Master-Detail Application中使用...

    Mastering iOS 11 Programming, 2nd Edition 2017年出版553页

    The journey to master iOS development and the new features of iOS 11 is not straightforward, but this book will help you make that transition. Written for Swift 4 and following the latest Swift API ...

    一步一步学习_iOS_6_编程(第四版)

    第二十五部分:分割视图控制器(UISplitViewController)和Master-Detail Application模板 第二十六部分:应用UIScrollView滚动视图和手势识别器 第二十七部分:Core Data持久化数据存储 第二十八部分: 使用SQLite...

    一步一步学习 iOS 6 编程(第四版)

    第二十五部分:分割视图控制器(UISplitViewController)和 Master-Detail Application 模板 第二十六部分:应用 UIScrollView 滚劢视图和手势识别器 第二十七部分:Core Data 持久化数据存储 第二十八部分: 使用 SQLite ...

    一步一步学习IOS6

    第二十五部分:分割视图控制器(UISplitViewController)和Master-Detail Application模板 第二十六部分:应用UIScrollView滚动视图和手势识别器 第二十七部分:Core Data持久化数据存储 第二十八部分: 使用SQLite...

    iOS 10 App Development Essentials

    33. An iOS 10 Split View Master-Detail Example 34. A Guide to Multitasking in iOS 10 35. An iOS 10 Multitasking Example 36. Working with Directories in Swift on iOS 10 37. Working with Files in Swift ...

    ios-swift-uisplitviewcontroller-ios8:适用于 iOS 7 和 iOS 8 的 UISplitViewController

    这个演示项目是由 XCode 6.1 用“Master-Detail Application”模板创建的。 构建的应用程序不适用于 iOS 7,因为模板使用了一种新方法,该方法仅在 SDK 8 之后可用( UISplitViewController::displayModeButtonItem...

    iOS.8.App.Development.Essentials

    An iOS 8 Split View Master-Detail Example Chapter 31. Implementing a Page based iOS 8 Application using UIPageViewController Chapter 32. An Example iOS 8 UIPageViewController Application Chapter 33. ...

    Xamarin Mobile Application Development for iOS

    Xamarin Mobile Application Development for iOS is not just your normal everyday book on iOS app development. Everything is written for a point and not for effect, and therefore you will learn ...

    iOS.9.App.Development.Essentials

    An iOS 9 Split View Master-Detail Example Chapter 34. A Guide to Multitasking in iOS 9 Chapter 35. An iOS 9 Multitasking Example Chapter 36. Implementing a Page based iOS 9 Application with ...

    Devart_UniDAC_6.3.13_for_DX10.1

    Bug with using parameters and column aliases in Master-Detail relation is fixed Bug with assertion failure on editing data in SmartFetch mode is fixed Oracle data provider Bug with memory leak on ...

    Devart_UniDAC_6.3.13_for_XE8

    Bug with using parameters and column aliases in Master-Detail relation is fixed Bug with assertion failure on editing data in SmartFetch mode is fixed Oracle data provider Bug with memory leak on ...

    Beginning Swift: Master the fundamentals of programming in Swift 4 pdf

    Beginning Swift: Master the fundamentals of programming in Swift 4 pdf Master the fundamentals of programming in Swift 4 Key Features Covers theory and practice in equal parts Teaches you how to ...

    Mastering.Android.Wear.Application.Development

    This book is for application developers (web, mobile, and desktop) who are interested in building new wearable apps, and mobile developers who already have apps on iTunes or Google Play Store and are ...

    Packt.Swift.Developing.iOS.Applications.2016

    This course includes all the resources that will help you jump into the app development .This course covers all the important aspects Swift application development and is divided into individual ...

    Android.Programming.The.Big.Nerd.Ranch.Guide.2nd.Edition.0134171454.epub

    Two-Pane Master-Detail Interfaces Chapter 18. Assets Chapter 19. Audio Playback with SoundPool Chapter 20. Styles and Themes Chapter 21. XML Drawables Chapter 22. More About Intents and Tasks Chapter...

    Mobile.Device.Exploitation.Cookbook.1783558725

    Over 40 recipes to master mobile device penetration testing with open source tools About This Book Learn application exploitation for popular mobile platforms Improve the current security level for ...

    Mastering.JavaScript.High.Performance.1784397296

    Master the art of building, deploying, and optimizing faster web applications with JavaScript About This Book Test and optimize JavaScript code efficiently Build faster and more proficient JavaScript...

    Azure and Xamarin Forms 2018

    Discover how to create cross platform apps for Android, iOS and UWP using Azure services and C# with Xamarin Forms. This book illustrates how to utilize Azure cloud storage for serving up Azure SQL DB...

Global site tag (gtag.js) - Google Analytics