Loading presentation...
Prezi is an interactive zooming presentation

Present Remotely

Send the link below via email or IM

Copy

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.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

BPStudy #46

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

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
+
Instanciate
+
Layout Potential memory leak
or
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