SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
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.

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 아이폰강의(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
 

Similaire à 아이폰강의(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
 

Plus de 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
 

Plus de 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)
 

Dernier

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Dernier (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

아이폰강의(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.