SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
Adopting Model-View-
 Controller in Cocoa
  and Objective-C
             Graham Lee
     http://twitter.com/iamleeg
Memory Lane
Memory Lane
•   1980s: Brad Cox at StepStone adds Smalltalk
    messaging to C. Some guy named Bjarne invents
    “C with Classes”.
Memory Lane
•   1980s: Brad Cox at StepStone adds Smalltalk
    messaging to C. Some guy named Bjarne invents
    “C with Classes”.

•   1986: Cox authors Object Oriented Programming: an
    evolutionary approach, ObjC is born
Memory Lane
•   1980s: Brad Cox at StepStone adds Smalltalk
    messaging to C. Some guy named Bjarne invents
    “C with Classes”.

•   1986: Cox authors Object Oriented Programming: an
    evolutionary approach, ObjC is born

•   1988: NeXT licence ObjC from StepStone
Memory Lane
•   1980s: Brad Cox at StepStone adds Smalltalk
    messaging to C. Some guy named Bjarne invents
    “C with Classes”.

•   1986: Cox authors Object Oriented Programming: an
    evolutionary approach, ObjC is born

•   1988: NeXT licence ObjC from StepStone

•   1993: GCC runtime for ObjC on !NeXT OS
Memory Lane
•   1980s: Brad Cox at StepStone adds Smalltalk
    messaging to C. Some guy named Bjarne invents
    “C with Classes”.

•   1986: Cox authors Object Oriented Programming: an
    evolutionary approach, ObjC is born

•   1988: NeXT licence ObjC from StepStone

•   1993: GCC runtime for ObjC on !NeXT OS

•   1995: NeXT purchase all ObjC rights
Memory Lane
•   1980s: Brad Cox at StepStone adds Smalltalk
    messaging to C. Some guy named Bjarne invents
    “C with Classes”.

•   1986: Cox authors Object Oriented Programming: an
    evolutionary approach, ObjC is born

•   1988: NeXT licence ObjC from StepStone

•   1993: GCC runtime for ObjC on !NeXT OS

•   1995: NeXT purchase all ObjC rights

•   1996: Apple (Computer, back then) acquire NeXT
Memory Lane
•   1980s: Brad Cox at StepStone adds Smalltalk
    messaging to C. Some guy named Bjarne invents
    “C with Classes”.

•   1986: Cox authors Object Oriented Programming: an
    evolutionary approach, ObjC is born

•   1988: NeXT licence ObjC from StepStone

•   1993: GCC runtime for ObjC on !NeXT OS

•   1995: NeXT purchase all ObjC rights

•   1996: Apple (Computer, back then) acquire NeXT

•   2001: Mac OS X released
What does MVC mean?
What does MVC mean?
          Display information




          Prepare content




                  Provide information
What does MVC mean?
   Respond to events      Display information




  Trigger service logic   Prepare content




 Do the work                      Provide information
Demo - one-minute
    browser
What did I do?
What did I do?
• Drew boxes in Interface Builder
What did I do?
• Drew boxes in Interface Builder
• Automatically created and archived View
  objects
What did I do?
• Drew boxes in Interface Builder
• Automatically created and archived View
  objects
• Automatically un-archived and displayed by
  my app
What did I do?
• Drew boxes in Interface Builder
• Automatically created and archived View
  objects
• Automatically un-archived and displayed by
  my app
• MVC score: F    Should really try harder
On syntax
On syntax

• [anObject   sendMessage: parameter];
On syntax

• [anObject sendMessage: parameter];
• @property int count;
• int x = anObject.count;
• anObject.count = x * 2;
Demo - model the URL
MVC Score: D Principles not really applied
Delegates
Delegates
• Customise an object’s behaviour by making
  decisions on its behalf
Delegates
• Customise an object’s behaviour by making
  decisions on its behalf
• GoF: Template Method (kindof)
Delegates
• Customise an object’s behaviour by making
  decisions on its behalf
• GoF: Template Method (kindof)
• Implement a subset of delegate methods,
  runtime introspection avoids exceptions
Delegates
• Customise an object’s behaviour by making
  decisions on its behalf
• GoF: Template Method (kindof)
• Implement a subset of delegate methods,
  runtime introspection avoids exceptions
• We’ll use WebFrameLoadDelegate
Demo - fix the address
        bar
Demo - fix the address
        bar
     (oh, and add window titles)
Cocoa Bindings
Cocoa Bindings


  «bind»
Cocoa Bindings


  «bind»   «observe»
MVC Score: B Good, but I want bookmarks ☺
Demo - bookmarks
MVC Score: A That’ll do for now!
?

Weitere ähnliche Inhalte

Mehr von Graham Lee

Beyond build and analyze
Beyond build and analyzeBeyond build and analyze
Beyond build and analyzeGraham Lee
 
Sign your code
Sign your codeSign your code
Sign your codeGraham Lee
 
Unit testing for Cocoa developers
Unit testing for Cocoa developersUnit testing for Cocoa developers
Unit testing for Cocoa developersGraham Lee
 
Security and Encryption on iOS
Security and Encryption on iOSSecurity and Encryption on iOS
Security and Encryption on iOSGraham Lee
 
Dial M For Mitigation
Dial M For MitigationDial M For Mitigation
Dial M For MitigationGraham Lee
 
Presentations and Podcasts - OxMug July 2009
Presentations and Podcasts - OxMug July 2009Presentations and Podcasts - OxMug July 2009
Presentations and Podcasts - OxMug July 2009Graham Lee
 
Intel Briefing Notes
Intel Briefing NotesIntel Briefing Notes
Intel Briefing NotesGraham Lee
 
Designing a Secure Cocoa App
Designing a Secure Cocoa AppDesigning a Secure Cocoa App
Designing a Secure Cocoa AppGraham Lee
 

Mehr von Graham Lee (8)

Beyond build and analyze
Beyond build and analyzeBeyond build and analyze
Beyond build and analyze
 
Sign your code
Sign your codeSign your code
Sign your code
 
Unit testing for Cocoa developers
Unit testing for Cocoa developersUnit testing for Cocoa developers
Unit testing for Cocoa developers
 
Security and Encryption on iOS
Security and Encryption on iOSSecurity and Encryption on iOS
Security and Encryption on iOS
 
Dial M For Mitigation
Dial M For MitigationDial M For Mitigation
Dial M For Mitigation
 
Presentations and Podcasts - OxMug July 2009
Presentations and Podcasts - OxMug July 2009Presentations and Podcasts - OxMug July 2009
Presentations and Podcasts - OxMug July 2009
 
Intel Briefing Notes
Intel Briefing NotesIntel Briefing Notes
Intel Briefing Notes
 
Designing a Secure Cocoa App
Designing a Secure Cocoa AppDesigning a Secure Cocoa App
Designing a Secure Cocoa App
 

Kürzlich hochgeladen

Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - AvrilIvanti
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 

Kürzlich hochgeladen (20)

Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - Avril
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
How Tech Giants Cut Corners to Harvest Data for A.I.
How Tech Giants Cut Corners to Harvest Data for A.I.How Tech Giants Cut Corners to Harvest Data for A.I.
How Tech Giants Cut Corners to Harvest Data for A.I.
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 

Adopting MVC in Cocoa

  • 1. Adopting Model-View- Controller in Cocoa and Objective-C Graham Lee http://twitter.com/iamleeg
  • 3. Memory Lane • 1980s: Brad Cox at StepStone adds Smalltalk messaging to C. Some guy named Bjarne invents “C with Classes”.
  • 4. Memory Lane • 1980s: Brad Cox at StepStone adds Smalltalk messaging to C. Some guy named Bjarne invents “C with Classes”. • 1986: Cox authors Object Oriented Programming: an evolutionary approach, ObjC is born
  • 5. Memory Lane • 1980s: Brad Cox at StepStone adds Smalltalk messaging to C. Some guy named Bjarne invents “C with Classes”. • 1986: Cox authors Object Oriented Programming: an evolutionary approach, ObjC is born • 1988: NeXT licence ObjC from StepStone
  • 6. Memory Lane • 1980s: Brad Cox at StepStone adds Smalltalk messaging to C. Some guy named Bjarne invents “C with Classes”. • 1986: Cox authors Object Oriented Programming: an evolutionary approach, ObjC is born • 1988: NeXT licence ObjC from StepStone • 1993: GCC runtime for ObjC on !NeXT OS
  • 7. Memory Lane • 1980s: Brad Cox at StepStone adds Smalltalk messaging to C. Some guy named Bjarne invents “C with Classes”. • 1986: Cox authors Object Oriented Programming: an evolutionary approach, ObjC is born • 1988: NeXT licence ObjC from StepStone • 1993: GCC runtime for ObjC on !NeXT OS • 1995: NeXT purchase all ObjC rights
  • 8. Memory Lane • 1980s: Brad Cox at StepStone adds Smalltalk messaging to C. Some guy named Bjarne invents “C with Classes”. • 1986: Cox authors Object Oriented Programming: an evolutionary approach, ObjC is born • 1988: NeXT licence ObjC from StepStone • 1993: GCC runtime for ObjC on !NeXT OS • 1995: NeXT purchase all ObjC rights • 1996: Apple (Computer, back then) acquire NeXT
  • 9. Memory Lane • 1980s: Brad Cox at StepStone adds Smalltalk messaging to C. Some guy named Bjarne invents “C with Classes”. • 1986: Cox authors Object Oriented Programming: an evolutionary approach, ObjC is born • 1988: NeXT licence ObjC from StepStone • 1993: GCC runtime for ObjC on !NeXT OS • 1995: NeXT purchase all ObjC rights • 1996: Apple (Computer, back then) acquire NeXT • 2001: Mac OS X released
  • 10. What does MVC mean?
  • 11. What does MVC mean? Display information Prepare content Provide information
  • 12. What does MVC mean? Respond to events Display information Trigger service logic Prepare content Do the work Provide information
  • 13. Demo - one-minute browser
  • 14. What did I do?
  • 15. What did I do? • Drew boxes in Interface Builder
  • 16. What did I do? • Drew boxes in Interface Builder • Automatically created and archived View objects
  • 17. What did I do? • Drew boxes in Interface Builder • Automatically created and archived View objects • Automatically un-archived and displayed by my app
  • 18. What did I do? • Drew boxes in Interface Builder • Automatically created and archived View objects • Automatically un-archived and displayed by my app • MVC score: F Should really try harder
  • 20. On syntax • [anObject sendMessage: parameter];
  • 21. On syntax • [anObject sendMessage: parameter]; • @property int count; • int x = anObject.count; • anObject.count = x * 2;
  • 22. Demo - model the URL
  • 23.
  • 24.
  • 25. MVC Score: D Principles not really applied
  • 27. Delegates • Customise an object’s behaviour by making decisions on its behalf
  • 28. Delegates • Customise an object’s behaviour by making decisions on its behalf • GoF: Template Method (kindof)
  • 29. Delegates • Customise an object’s behaviour by making decisions on its behalf • GoF: Template Method (kindof) • Implement a subset of delegate methods, runtime introspection avoids exceptions
  • 30. Delegates • Customise an object’s behaviour by making decisions on its behalf • GoF: Template Method (kindof) • Implement a subset of delegate methods, runtime introspection avoids exceptions • We’ll use WebFrameLoadDelegate
  • 31. Demo - fix the address bar
  • 32. Demo - fix the address bar (oh, and add window titles)
  • 34. Cocoa Bindings «bind»
  • 35. Cocoa Bindings «bind» «observe»
  • 36.
  • 37.
  • 38.
  • 39. MVC Score: B Good, but I want bookmarks ☺
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46. MVC Score: A That’ll do for now!
  • 47. ?

Hinweis der Redaktion

  1. Who I am. What _are_ Objective-C and Cocoa? First, a walk down memory lane.
  2. Objective-C was really popularised by NeXT on their NeXTSTEP OS. Note that there’s never been a language standard, but Apple owns all trademarks and drives the language definition. GCC support on other platforms plays catch-up. Next: what exactly is MVC?
  3. Objective-C was really popularised by NeXT on their NeXTSTEP OS. Note that there’s never been a language standard, but Apple owns all trademarks and drives the language definition. GCC support on other platforms plays catch-up. Next: what exactly is MVC?
  4. Objective-C was really popularised by NeXT on their NeXTSTEP OS. Note that there’s never been a language standard, but Apple owns all trademarks and drives the language definition. GCC support on other platforms plays catch-up. Next: what exactly is MVC?
  5. Objective-C was really popularised by NeXT on their NeXTSTEP OS. Note that there’s never been a language standard, but Apple owns all trademarks and drives the language definition. GCC support on other platforms plays catch-up. Next: what exactly is MVC?
  6. Objective-C was really popularised by NeXT on their NeXTSTEP OS. Note that there’s never been a language standard, but Apple owns all trademarks and drives the language definition. GCC support on other platforms plays catch-up. Next: what exactly is MVC?
  7. Objective-C was really popularised by NeXT on their NeXTSTEP OS. Note that there’s never been a language standard, but Apple owns all trademarks and drives the language definition. GCC support on other platforms plays catch-up. Next: what exactly is MVC?
  8. Objective-C was really popularised by NeXT on their NeXTSTEP OS. Note that there’s never been a language standard, but Apple owns all trademarks and drives the language definition. GCC support on other platforms plays catch-up. Next: what exactly is MVC?
  9. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  10. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  11. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  12. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  13. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  14. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  15. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  16. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  17. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  18. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  19. Well, we know it’s Model-View-Controller, I put that on the first slide. But what does each level do? Next: into the sample.
  20. I could do 45 of these in one session - it’s a shame there’s no market.
  21. So we can see how Interface Builder works, but haven’t designed an MVC app at all. FAIL. Next: see what does really count as a model.
  22. So we can see how Interface Builder works, but haven’t designed an MVC app at all. FAIL. Next: see what does really count as a model.
  23. So we can see how Interface Builder works, but haven’t designed an MVC app at all. FAIL. Next: see what does really count as a model.
  24. So we can see how Interface Builder works, but haven’t designed an MVC app at all. FAIL. Next: see what does really count as a model.
  25. So we can see how Interface Builder works, but haven’t designed an MVC app at all. FAIL. Next: see what does really count as a model.
  26. Brief description of the message-sending syntax and Objective-C 2.0 properties. Just enough so that the code samples make sense.
  27. Brief description of the message-sending syntax and Objective-C 2.0 properties. Just enough so that the code samples make sense.
  28. Brief description of the message-sending syntax and Objective-C 2.0 properties. Just enough so that the code samples make sense.
  29. Brief description of the message-sending syntax and Objective-C 2.0 properties. Just enough so that the code samples make sense.
  30. The only model object we really have is the URL. Let’s see how we can factor that out into an MVC design. Next: class view.
  31. So, we’ve separated things out, but that model object isn’t really used. The Controller is just filling it in out of a sense of duty. Next: move onto fixing the URL field, but discuss delegates first.
  32. So, we’ve separated things out, but that model object isn’t really used. The Controller is just filling it in out of a sense of duty. Next: move onto fixing the URL field, but discuss delegates first.
  33. So, we’ve separated things out, but that model object isn’t really used. The Controller is just filling it in out of a sense of duty. Next: move onto fixing the URL field, but discuss delegates first.
  34. So, we’ve separated things out, but that model object isn’t really used. The Controller is just filling it in out of a sense of duty. Next: move onto fixing the URL field, but discuss delegates first.
  35. So, we’ve separated things out, but that model object isn’t really used. The Controller is just filling it in out of a sense of duty. Next: move onto fixing the URL field, but discuss delegates first.
  36. Some objects implement a basic behaviour then allow another object to interpose at specific points in the process. This is called delegation in Cocoa. It’s a bit like a Template Method, except that the delegate doesn’t encapsulate the original object. ObjC messaging means you can implement a subset of the delegate methods.
  37. Some objects implement a basic behaviour then allow another object to interpose at specific points in the process. This is called delegation in Cocoa. It’s a bit like a Template Method, except that the delegate doesn’t encapsulate the original object. ObjC messaging means you can implement a subset of the delegate methods.
  38. Some objects implement a basic behaviour then allow another object to interpose at specific points in the process. This is called delegation in Cocoa. It’s a bit like a Template Method, except that the delegate doesn’t encapsulate the original object. ObjC messaging means you can implement a subset of the delegate methods.
  39. Some objects implement a basic behaviour then allow another object to interpose at specific points in the process. This is called delegation in Cocoa. It’s a bit like a Template Method, except that the delegate doesn’t encapsulate the original object. ObjC messaging means you can implement a subset of the delegate methods.
  40. We can use a delegation point in the loading of a web page in order to get the address that the web view has really gone to. Oh, where’s the code to update the text field, though?
  41. If a view (say) binds to a model, then the model is actually replaced by a proxy which posts observer notifications whenever changes are requested. Next: how that works in the browser app.
  42. If a view (say) binds to a model, then the model is actually replaced by a proxy which posts observer notifications whenever changes are requested. Next: how that works in the browser app.
  43. If a view (say) binds to a model, then the model is actually replaced by a proxy which posts observer notifications whenever changes are requested. Next: how that works in the browser app.
  44. If a view (say) binds to a model, then the model is actually replaced by a proxy which posts observer notifications whenever changes are requested. Next: how that works in the browser app.
  45. If a view (say) binds to a model, then the model is actually replaced by a proxy which posts observer notifications whenever changes are requested. Next: how that works in the browser app.
  46. If a view (say) binds to a model, then the model is actually replaced by a proxy which posts observer notifications whenever changes are requested. Next: how that works in the browser app.
  47. So apart from triggering the “go” operation, the text field and web view are entirely decoupled. The model now has some utility. Next: bookmarks.
  48. So apart from triggering the “go” operation, the text field and web view are entirely decoupled. The model now has some utility. Next: bookmarks.
  49. So apart from triggering the “go” operation, the text field and web view are entirely decoupled. The model now has some utility. Next: bookmarks.
  50. So apart from triggering the “go” operation, the text field and web view are entirely decoupled. The model now has some utility. Next: bookmarks.
  51. So apart from triggering the “go” operation, the text field and web view are entirely decoupled. The model now has some utility. Next: bookmarks.
  52. So apart from triggering the “go” operation, the text field and web view are entirely decoupled. The model now has some utility. Next: bookmarks.
  53. Add the bookmarks. No need to change the model, just bind the new UI to a collection of web addresses.
  54. First: NSArrayController manages its content Second: Add bookmark, note how information only passed over the controller layer Third: Bookmark this page, again information flow over controller layer only Next: Qs!
  55. First: NSArrayController manages its content Second: Add bookmark, note how information only passed over the controller layer Third: Bookmark this page, again information flow over controller layer only Next: Qs!
  56. First: NSArrayController manages its content Second: Add bookmark, note how information only passed over the controller layer Third: Bookmark this page, again information flow over controller layer only Next: Qs!
  57. First: NSArrayController manages its content Second: Add bookmark, note how information only passed over the controller layer Third: Bookmark this page, again information flow over controller layer only Next: Qs!
  58. First: NSArrayController manages its content Second: Add bookmark, note how information only passed over the controller layer Third: Bookmark this page, again information flow over controller layer only Next: Qs!
  59. First: NSArrayController manages its content Second: Add bookmark, note how information only passed over the controller layer Third: Bookmark this page, again information flow over controller layer only Next: Qs!
  60. First: NSArrayController manages its content Second: Add bookmark, note how information only passed over the controller layer Third: Bookmark this page, again information flow over controller layer only Next: Qs!
  61. First: NSArrayController manages its content Second: Add bookmark, note how information only passed over the controller layer Third: Bookmark this page, again information flow over controller layer only Next: Qs!
  62. First: NSArrayController manages its content Second: Add bookmark, note how information only passed over the controller layer Third: Bookmark this page, again information flow over controller layer only Next: Qs!