Loading presentation...

Present Remotely

Send the link below via email or IM


Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.


BPStudy #46

初心者が必ず間違えるUIViewControllerの実装〜非同期処理に強いView Controllerのつくりかた〜

Masashi Ono

on 30 June 2011

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of BPStudy #46

BPStudy #46 ~ To make your UIViewController Async-proof ~ Agenda Introduction
Async calls in iOS
What's the problem?
From "MVC" to "MVCS"
Async-proof view controllers
Conclusion Introduction Async calls in iOS What's the problem? From "MVC" to "MVCS" Async-proof view controllers Conclusion Network Location (GPS) Apple Push Notification In App Purchase Media Playback Hard to chain Unpredictable timings Multithreading Working with async is HARD Too many types of codes in a single view controller! >< "Draw-Redraw" doesn't work on async codes Updating views So... Decouple "Domain Logic" from view controllers "Instanciate-Update-Layout" architecture "Draw-Redraw" code of views Draw = Instanciate
Layout Redraw = Deallocate
Layout Potential memory leak
CRASH Traditional (Web) MVC iOS MVC M odel
V iew
C ontroller What does "Controller" actually control? 2 different "Controller"s Model View Controller Use-case Controller (a.k.a. Service Layer) Application Controller to M odel
V iew
C ontroller
S ervice from "Patterns of EnterPrise Application Architecture", Martin Fowler Flow of views - Navigation
Flow of logics - Domain Logic We need Services for reusability
for maintenancability
for testability "Instanciate-Update-Layout" view outlets Update = Update Instanciate = Instanciate Layout = Layout Instanciate Update Layout NO deadly deallocation / reinstanciation API request finished
Location changed device rotation Extra caution for Core Data usage in view controller Copy before using many-to-many Think before retaining Consider using value objects NEVER update without lock Thank you for listening!
Full transcript