SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
Chapter 6
                Bit Academy
•
               •   MVC

               •
               •
plain tableview   grouped tableview




          - section
             section header
             section footer                                .
          - row
TableviewCell
               row   tableViewCell              .     4                            .




                             image is allowed   image is not allowed     image is not allowed
image is allowed
                             subtitle           subtitle right aligned   main title is in blue
                                                                         subtitle left aligned
•   UITableViewController Class :
                   UITableViewDelegate & UITableViewDataSource
                                   ,               , TableView
                             .

               •   UITableView Class :


               •   UITableViewCell Class : row
Cell Object

                       disclosure indicators, detail disclosure controls, control objects such as sliders or
                       switches, and custom views




               ,                       (reordering)
                   .
Accessary View
                 Disclosure indicator—
                 UITableViewCellAccessoryDisclosureIndicator.
                 disclosure indicator
                         .




                 Detail disclosure button—
                 UITableViewCellAccessoryDetailDisclosureButton.
                 detail disclosure button                              .
                                                                   .




                 Check mark—UITableViewCellAccessoryCheckmark.
                                                        .
                                                     .
DataSource & Delegate Protocol

               - UITableView          Data Source
               delegate                                                       .
               application delegate   custom UITableViewController                .

               - data source   UITableViewDataSource    protocol   delegate
               UITableViewDelegate protocol                  .

               - data source   UITableView
                    .                  row          ,
                                                               .

               - Delegate
                                                        .
Data Source Protocol


                                                  Data Source Object
                                                 (TableViewController
                                             or Application Delegate object)

                                                                           (   )



                                        UITableView Data Source Protocol
                                        Configuring a Table View
                                         1   – tableView:cellForRowAtIndexPath:  required method
                                    .    2   – numberOfSectionsInTableView:
                                         3   – tableView:numberOfRowsInSection:  required method
                                         4   – sectionIndexTitlesForTableView:
                          .
                                         5   – tableView:sectionForSectionIndexTitle:atIndex:
                                         6   – tableView:titleForHeaderInSection:
               Data Source Object
                                         7   – tableView:titleForFooterInSection:
                                        Inserting or Deleting Table Rows
                                         1   – tableView:commitEditingStyle:forRowAtIndexPath:
                                         2   – tableView:canEditRowAtIndexPath:
                                        Reordering Table Rows
                                         1
                                         2
                                             – tableView:canMoveRowAtIndexPath:
                                             – tableView:moveRowAtIndexPath:toIndexPath:
                                                                                                   Delegate
Delegate Protocol
                                                      Delegate Object
                                                   (TableViewController
                                               or Application Delegate object)

                                                                             (   )


                                          UITableView DelegateProtocol
                                          Configuring Rows for the Table View
                                           1   – tableView:heightForRowAtIndexPath:
                                           2   – tableView:indentationLevelForRowAtIndexPath:
                                           3   – tableView:willDisplayCell:forRowAtIndexPath:
RowAtIndexPath
                               Delegate   Managing Accessory Views
                                           1   – tableView:accessoryButtonTappedForRowWithIndexPath:
           .                               2   – tableView:accessoryTypeForRowWithIndexPath: Deprecated in iOS 3.0
                         .                Managing Selections
                                           1   – tableView:willSelectRowAtIndexPath:
                                           2   – tableView:didSelectRowAtIndexPath:
                                           3   – tableView:willDeselectRowAtIndexPath:
                                           4   – tableView:didDeselectRowAtIndexPath:
                                          Modifying the Header and Footer of Sections
                                           1   – tableView:viewForHeaderInSection:
                                           2   – tableView:viewForFooterInSection:
                                           3   – tableView:heightForHeaderInSection:
                                           4   – tableView:heightForFooterInSection:
                                          Editing Table Rows
                                           1   – tableView:willBeginEditingRowAtIndexPath:
                                           2   – tableView:didEndEditingRowAtIndexPath:
                                           3   – tableView:editingStyleForRowAtIndexPath:
                                           4   – tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:
                                           5   – tableView:shouldIndentWhileEditingRowAtIndexPath:
                                          Reordering Table Rows
                                           1   – tableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath:
RootViewController.m
                                                    TableView                                                       SimpleHumanResourceAppDelegate.m
                                                                                                          applicationDidFinishLaunching UIApplication
                          NSInteger numberOfSectionsInTableView   UITableView   tableView          application
                                  ;                                                                "    personnel             alloc initWithArray self
                                                                                                   createEmployees ;
                                                                                                   "     window addSubview navigationController view ;
                                                                                                        window makeKeyAndVisible ;


                                                                    DataSource
               TableView                                            & Delegate
                                                                                                                   NSArray


     NSInteger tableView UITableView   tableView numberOfRowsInSection               NSInteger section
"         rowCount     self appDelegate .personnel count ;
            rowCount;
  

                                                                          TableView         Data Source                          row
                                                                               tableView:cellForRowAtIndexPath:                    cell
                                                                            TableView            .
              UITableViewCell     tableView   UITableView   tableView cellForRowAtIndexPath                   indexPath
      
                                CellIdentifier         ;
      
               UITableViewCell cell     tableView dequeueReusableCellWithIdentifier CellIdentifier ;
                  cell
                   cell      UITableViewCell alloc initWithStyle UITableViewCellStyleValue1 reuseIdentifier CellIdentifier            autorelease ;

      
     "                   personnel   self appDelegate .personnel;
     "                      employee    personnel objectAtIndex indexPath.row ;
     "          cell.textLabel.text    employee valueForKey                   ;
     "          cell.detailTextLabel.text    employee valueForKey                              ;
                     cell;
cell

                                   .
                    ,     reuseIdentifier               .


                                                                              reuseIdentifier

    UITableViewCell       tableView    UITableView      tableView cellForRowAtIndexPath       indexPath
 
                        CellIdentifier              ;
 
    UITableViewCell cell     tableView dequeueReusableCellWithIdentifier CellIdentifier ;
       cell
        cell      UITableViewCell alloc initWithStyle UITableViewCellStyleValue1 reuseIdentifier CellIdentifier
autorelease ;

 
"                personnel    self appDelegate .personnel;
"                   employee     personnel objectAtIndex indexPath.row ;
"        cell.textLabel.text    employee valueForKey                   ;
"        cell.detailTextLabel.text    employee valueForKey                                ;
              cell;
XCode
                                                                               Navigation-based application template
                   1. In Xcode, choose New Project from the File menu.
                   2. Select the Navigation-based Application template project and click Choose.
                   3. Specify a name and location for the project and click Save.




RootViewController : datasource, delegate

MyTableViewAppDelegate : application
delegate
MainWindow.xib:
RootViewController.xib:
MainWindow.Xib
                           MainWindow.xib nib file

 Root View Controller     View   Table View             .

 The application delegate displaying the initial user interface
 - (void)applicationDidFinishLaunching:(UIApplication *)application {



          [window addSubview:[navigationController view]];

          [window makeKeyAndVisible];

 }




                                                                            view
viewController                   . RootViewController         TableViewController
     tableView                   .
root view controller’s nib for view


          document window       Root View
          Controller object        .
              NIB Name        RootViewController
                               .



            root view controller
          root view controller NIB Name
               RootViewController.Nib
                   .
RootViewController.xib

  RootViewController      table view
              , File’s Owner
  (RootViewController)
        .



  tableView (UITableViewController Class)
  Returns the table view managed by the controller object.

  @property(nonatomic, retain) UITableView *tableView

  view property inherited from UIViewController

TableView                                 property
dataSource
The object that acts as the data source of the receiving table view.

@property(nonatomic, assign) id<UITableViewDataSource> dataSource
Discussion
The data source must adopt the UITableViewDataSource protocol. The data source is not retained.
                                                                                            RootViewController
delegate                                                                                    Table View       property
The object that acts as the delegate of the receiving table view.                           TableView       dataSource protocol delegate protocol
@property(nonatomic, assign) id<UITableViewDelegate> delegate                               RootViewController                 .
Discussion
The delegate must adopt the UITableViewDelegate protocol. The delegate is not retained.

Weitere ähnliche Inhalte

Was ist angesagt?

Learning Appcelerator® Alloy™
Learning Appcelerator® Alloy™Learning Appcelerator® Alloy™
Learning Appcelerator® Alloy™Ricardo Alcocer
 
Михаил Крайнюк - Form API + Drupal 8: Form and AJAX
Михаил Крайнюк - Form API + Drupal 8: Form and AJAXМихаил Крайнюк - Form API + Drupal 8: Form and AJAX
Михаил Крайнюк - Form API + Drupal 8: Form and AJAXDrupalSib
 
MidCamp 2016 - Demystifying AJAX Callback Commands in Drupal 8
MidCamp 2016 - Demystifying AJAX Callback Commands in Drupal 8MidCamp 2016 - Demystifying AJAX Callback Commands in Drupal 8
MidCamp 2016 - Demystifying AJAX Callback Commands in Drupal 8Michael Miles
 
Understanding
Understanding Understanding
Understanding Arun Gupta
 
Introduction to SQL Antipatterns
Introduction to SQL AntipatternsIntroduction to SQL Antipatterns
Introduction to SQL AntipatternsKrishnakumar S
 
The Magic of WPF & MVVM
The Magic of WPF & MVVMThe Magic of WPF & MVVM
The Magic of WPF & MVVMAbhishek Sur
 
Cake php 1.2-cheatsheet
Cake php 1.2-cheatsheetCake php 1.2-cheatsheet
Cake php 1.2-cheatsheetPrinceGuru MS
 
Building mobile web apps with Mobello
Building mobile web apps with MobelloBuilding mobile web apps with Mobello
Building mobile web apps with MobelloJeong-Geun Kim
 
Spring MVC Annotations
Spring MVC AnnotationsSpring MVC Annotations
Spring MVC AnnotationsJordan Silva
 

Was ist angesagt? (15)

Spring by rj
Spring by rjSpring by rj
Spring by rj
 
Jsf intro
Jsf introJsf intro
Jsf intro
 
Learning Appcelerator® Alloy™
Learning Appcelerator® Alloy™Learning Appcelerator® Alloy™
Learning Appcelerator® Alloy™
 
Михаил Крайнюк - Form API + Drupal 8: Form and AJAX
Михаил Крайнюк - Form API + Drupal 8: Form and AJAXМихаил Крайнюк - Form API + Drupal 8: Form and AJAX
Михаил Крайнюк - Form API + Drupal 8: Form and AJAX
 
MidCamp 2016 - Demystifying AJAX Callback Commands in Drupal 8
MidCamp 2016 - Demystifying AJAX Callback Commands in Drupal 8MidCamp 2016 - Demystifying AJAX Callback Commands in Drupal 8
MidCamp 2016 - Demystifying AJAX Callback Commands in Drupal 8
 
Java &amp; banco de dados
Java &amp; banco de dadosJava &amp; banco de dados
Java &amp; banco de dados
 
Sql Antipatterns Strike Back
Sql Antipatterns Strike BackSql Antipatterns Strike Back
Sql Antipatterns Strike Back
 
Introduction to jsf 2
Introduction to jsf 2Introduction to jsf 2
Introduction to jsf 2
 
Understanding
Understanding Understanding
Understanding
 
Introduction to SQL Antipatterns
Introduction to SQL AntipatternsIntroduction to SQL Antipatterns
Introduction to SQL Antipatterns
 
The Magic of WPF & MVVM
The Magic of WPF & MVVMThe Magic of WPF & MVVM
The Magic of WPF & MVVM
 
Cake php 1.2-cheatsheet
Cake php 1.2-cheatsheetCake php 1.2-cheatsheet
Cake php 1.2-cheatsheet
 
Practical Object Oriented Models In Sql
Practical Object Oriented Models In SqlPractical Object Oriented Models In Sql
Practical Object Oriented Models In Sql
 
Building mobile web apps with Mobello
Building mobile web apps with MobelloBuilding mobile web apps with Mobello
Building mobile web apps with Mobello
 
Spring MVC Annotations
Spring MVC AnnotationsSpring MVC Annotations
Spring MVC Annotations
 

Ähnlich wie 아이폰강의(4) pdf

iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)Jonathan Engelsma
 
Cocoa heads testing and viewcontrollers
Cocoa heads testing and viewcontrollersCocoa heads testing and viewcontrollers
Cocoa heads testing and viewcontrollersStijn Willems
 
Swift Tableview iOS App Development
Swift Tableview iOS App DevelopmentSwift Tableview iOS App Development
Swift Tableview iOS App DevelopmentKetan Raval
 
아이폰강의(5) pdf
아이폰강의(5) pdf아이폰강의(5) pdf
아이폰강의(5) pdfsunwooindia
 
Session 14 - Working with table view and search bar
Session 14 - Working with table view and search barSession 14 - Working with table view and search bar
Session 14 - Working with table view and search barVu Tran Lam
 
Using a model view-view model architecture for iOS apps
Using a model view-view model architecture for iOS appsUsing a model view-view model architecture for iOS apps
Using a model view-view model architecture for iOS appsallanh0526
 
Declarative UI on iOS without SwiftUI (中文)
Declarative UI on iOS without SwiftUI (中文)Declarative UI on iOS without SwiftUI (中文)
Declarative UI on iOS without SwiftUI (中文)Shih-Ting Huang
 
iOS Beginners Lesson 2
iOS Beginners Lesson 2iOS Beginners Lesson 2
iOS Beginners Lesson 2Calvin Cheng
 
02 integrate highchart
02 integrate highchart02 integrate highchart
02 integrate highchartErhwen Kuo
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLAkhil Mittal
 

Ähnlich wie 아이폰강의(4) pdf (20)

iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)
 
IOS APPs Revision
IOS APPs RevisionIOS APPs Revision
IOS APPs Revision
 
201104 iphone navigation-based apps
201104 iphone navigation-based apps201104 iphone navigation-based apps
201104 iphone navigation-based apps
 
Objective c design pattens-architetcure
Objective c design pattens-architetcureObjective c design pattens-architetcure
Objective c design pattens-architetcure
 
Cocoa heads testing and viewcontrollers
Cocoa heads testing and viewcontrollersCocoa heads testing and viewcontrollers
Cocoa heads testing and viewcontrollers
 
iOS: Table Views
iOS: Table ViewsiOS: Table Views
iOS: Table Views
 
Swift Tableview iOS App Development
Swift Tableview iOS App DevelopmentSwift Tableview iOS App Development
Swift Tableview iOS App Development
 
занятие7
занятие7занятие7
занятие7
 
아이폰강의(5) pdf
아이폰강의(5) pdf아이폰강의(5) pdf
아이폰강의(5) pdf
 
Jpa
JpaJpa
Jpa
 
I os 11
I os 11I os 11
I os 11
 
DataFX - JavaOne 2013
DataFX - JavaOne 2013DataFX - JavaOne 2013
DataFX - JavaOne 2013
 
iOS
iOSiOS
iOS
 
Session 14 - Working with table view and search bar
Session 14 - Working with table view and search barSession 14 - Working with table view and search bar
Session 14 - Working with table view and search bar
 
Using a model view-view model architecture for iOS apps
Using a model view-view model architecture for iOS appsUsing a model view-view model architecture for iOS apps
Using a model view-view model architecture for iOS apps
 
Declarative UI on iOS without SwiftUI (中文)
Declarative UI on iOS without SwiftUI (中文)Declarative UI on iOS without SwiftUI (中文)
Declarative UI on iOS without SwiftUI (中文)
 
iOS Beginners Lesson 2
iOS Beginners Lesson 2iOS Beginners Lesson 2
iOS Beginners Lesson 2
 
Table views
Table viewsTable views
Table views
 
02 integrate highchart
02 integrate highchart02 integrate highchart
02 integrate highchart
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
 

Mehr von sunwooindia

아이폰강의(7) pdf
아이폰강의(7) pdf아이폰강의(7) pdf
아이폰강의(7) pdfsunwooindia
 
아이폰강의(6) pdf
아이폰강의(6) pdf아이폰강의(6) pdf
아이폰강의(6) pdfsunwooindia
 
2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서sunwooindia
 
2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서sunwooindia
 
2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서sunwooindia
 
아이폰강의(3)
아이폰강의(3)아이폰강의(3)
아이폰강의(3)sunwooindia
 
아이폰프로그래밍(2)
아이폰프로그래밍(2)아이폰프로그래밍(2)
아이폰프로그래밍(2)sunwooindia
 
오브젝트C(pdf)
오브젝트C(pdf)오브젝트C(pdf)
오브젝트C(pdf)sunwooindia
 

Mehr von sunwooindia (8)

아이폰강의(7) pdf
아이폰강의(7) pdf아이폰강의(7) pdf
아이폰강의(7) pdf
 
아이폰강의(6) pdf
아이폰강의(6) pdf아이폰강의(6) pdf
아이폰강의(6) pdf
 
2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서
 
2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서
 
2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서2011년 상반기 스마트폰이용실태조사 요약보고서
2011년 상반기 스마트폰이용실태조사 요약보고서
 
아이폰강의(3)
아이폰강의(3)아이폰강의(3)
아이폰강의(3)
 
아이폰프로그래밍(2)
아이폰프로그래밍(2)아이폰프로그래밍(2)
아이폰프로그래밍(2)
 
오브젝트C(pdf)
오브젝트C(pdf)오브젝트C(pdf)
오브젝트C(pdf)
 

Kürzlich hochgeladen

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Kürzlich hochgeladen (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

아이폰강의(4) pdf

  • 1. Chapter 6 Bit Academy
  • 2.
  • 3. • MVC • •
  • 4. plain tableview grouped tableview - section section header section footer . - row
  • 5. TableviewCell row tableViewCell . 4 . image is allowed image is not allowed image is not allowed image is allowed subtitle subtitle right aligned main title is in blue subtitle left aligned
  • 6. UITableViewController Class : UITableViewDelegate & UITableViewDataSource , , TableView . • UITableView Class : • UITableViewCell Class : row
  • 7. Cell Object disclosure indicators, detail disclosure controls, control objects such as sliders or switches, and custom views , (reordering) .
  • 8. Accessary View Disclosure indicator— UITableViewCellAccessoryDisclosureIndicator. disclosure indicator . Detail disclosure button— UITableViewCellAccessoryDetailDisclosureButton. detail disclosure button . . Check mark—UITableViewCellAccessoryCheckmark. . .
  • 9. DataSource & Delegate Protocol - UITableView Data Source delegate . application delegate custom UITableViewController . - data source UITableViewDataSource protocol delegate UITableViewDelegate protocol . - data source UITableView . row , . - Delegate .
  • 10. Data Source Protocol Data Source Object (TableViewController or Application Delegate object) ( ) UITableView Data Source Protocol Configuring a Table View 1 – tableView:cellForRowAtIndexPath:  required method . 2 – numberOfSectionsInTableView: 3 – tableView:numberOfRowsInSection:  required method 4 – sectionIndexTitlesForTableView: . 5 – tableView:sectionForSectionIndexTitle:atIndex: 6 – tableView:titleForHeaderInSection: Data Source Object 7 – tableView:titleForFooterInSection: Inserting or Deleting Table Rows 1 – tableView:commitEditingStyle:forRowAtIndexPath: 2 – tableView:canEditRowAtIndexPath: Reordering Table Rows 1 2 – tableView:canMoveRowAtIndexPath: – tableView:moveRowAtIndexPath:toIndexPath: Delegate
  • 11. Delegate Protocol Delegate Object (TableViewController or Application Delegate object) ( ) UITableView DelegateProtocol Configuring Rows for the Table View 1 – tableView:heightForRowAtIndexPath: 2 – tableView:indentationLevelForRowAtIndexPath: 3 – tableView:willDisplayCell:forRowAtIndexPath: RowAtIndexPath Delegate Managing Accessory Views 1 – tableView:accessoryButtonTappedForRowWithIndexPath: . 2 – tableView:accessoryTypeForRowWithIndexPath: Deprecated in iOS 3.0 . Managing Selections 1 – tableView:willSelectRowAtIndexPath: 2 – tableView:didSelectRowAtIndexPath: 3 – tableView:willDeselectRowAtIndexPath: 4 – tableView:didDeselectRowAtIndexPath: Modifying the Header and Footer of Sections 1 – tableView:viewForHeaderInSection: 2 – tableView:viewForFooterInSection: 3 – tableView:heightForHeaderInSection: 4 – tableView:heightForFooterInSection: Editing Table Rows 1 – tableView:willBeginEditingRowAtIndexPath: 2 – tableView:didEndEditingRowAtIndexPath: 3 – tableView:editingStyleForRowAtIndexPath: 4 – tableView:titleForDeleteConfirmationButtonForRowAtIndexPath: 5 – tableView:shouldIndentWhileEditingRowAtIndexPath: Reordering Table Rows 1 – tableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath:
  • 12.
  • 13. RootViewController.m TableView SimpleHumanResourceAppDelegate.m applicationDidFinishLaunching UIApplication NSInteger numberOfSectionsInTableView UITableView tableView application ; " personnel alloc initWithArray self createEmployees ; " window addSubview navigationController view ; window makeKeyAndVisible ; DataSource TableView & Delegate NSArray NSInteger tableView UITableView tableView numberOfRowsInSection NSInteger section " rowCount self appDelegate .personnel count ; rowCount;   TableView Data Source row tableView:cellForRowAtIndexPath: cell TableView . UITableViewCell tableView UITableView tableView cellForRowAtIndexPath indexPath   CellIdentifier ;   UITableViewCell cell tableView dequeueReusableCellWithIdentifier CellIdentifier ; cell cell UITableViewCell alloc initWithStyle UITableViewCellStyleValue1 reuseIdentifier CellIdentifier autorelease ;   " personnel self appDelegate .personnel; " employee personnel objectAtIndex indexPath.row ; " cell.textLabel.text employee valueForKey ; " cell.detailTextLabel.text employee valueForKey ; cell;
  • 14. cell . , reuseIdentifier . reuseIdentifier UITableViewCell tableView UITableView tableView cellForRowAtIndexPath indexPath   CellIdentifier ;   UITableViewCell cell tableView dequeueReusableCellWithIdentifier CellIdentifier ; cell cell UITableViewCell alloc initWithStyle UITableViewCellStyleValue1 reuseIdentifier CellIdentifier autorelease ;   " personnel self appDelegate .personnel; " employee personnel objectAtIndex indexPath.row ; " cell.textLabel.text employee valueForKey ; " cell.detailTextLabel.text employee valueForKey ; cell;
  • 15. XCode Navigation-based application template 1. In Xcode, choose New Project from the File menu. 2. Select the Navigation-based Application template project and click Choose. 3. Specify a name and location for the project and click Save. RootViewController : datasource, delegate MyTableViewAppDelegate : application delegate MainWindow.xib: RootViewController.xib:
  • 16. MainWindow.Xib MainWindow.xib nib file Root View Controller View Table View . The application delegate displaying the initial user interface - (void)applicationDidFinishLaunching:(UIApplication *)application { [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; } view viewController . RootViewController TableViewController tableView .
  • 17. root view controller’s nib for view document window Root View Controller object . NIB Name RootViewController . root view controller root view controller NIB Name RootViewController.Nib .
  • 18. RootViewController.xib RootViewController table view , File’s Owner (RootViewController) . tableView (UITableViewController Class) Returns the table view managed by the controller object. @property(nonatomic, retain) UITableView *tableView view property inherited from UIViewController TableView property dataSource The object that acts as the data source of the receiving table view. @property(nonatomic, assign) id<UITableViewDataSource> dataSource Discussion The data source must adopt the UITableViewDataSource protocol. The data source is not retained. RootViewController delegate Table View property The object that acts as the delegate of the receiving table view. TableView dataSource protocol delegate protocol @property(nonatomic, assign) id<UITableViewDelegate> delegate RootViewController . Discussion The delegate must adopt the UITableViewDelegate protocol. The delegate is not retained.