SlideShare a Scribd company logo
1 of 33
Download to read offline
Code and Slides:
                         http://thillerson.googlecode.com

                     iPhone Persistence           Tony Hillerson
                     For Mere Mortals             Software Architect




Tuesday, March 3, 2009
Persistence

                                  Code and Slides:
                         http://thillerson.googlecode.com




Tuesday, March 3, 2009
Persistence

                                  Code and Slides:
                         http://thillerson.googlecode.com


                           ... or it means saving stuff.




Tuesday, March 3, 2009
Persistence: Disclaimer

                                  Code and Slides:
                         http://thillerson.googlecode.com


                           BTW: I’m a n00b




Tuesday, March 3, 2009
Code and Slides:
                         http://thillerson.googlecode.com

      Persistence: Savin’ stuff on ur fone
      Your options




Tuesday, March 3, 2009
Persistence: Options

                                  Code and Slides:
                         http://thillerson.googlecode.com
                           Settings
                           SQLite
                           Filesystem
                           The Internets




Tuesday, March 3, 2009
Persistence: Options

                                  Code and Slides:
                         http://thillerson.googlecode.com
                           Settings
                           SQLite
                           Filesystem
                           The Internets




Tuesday, March 3, 2009
Persistence: Our Sweet App

                                  Code and Slides:
                         http://thillerson.googlecode.com




Tuesday, March 3, 2009
Persistence: Sweet Codes
  http://github.com/thillerson/grocery_getter/
                  Code and Slides:
         http://thillerson.googlecode.com
                         Download




Tuesday, March 3, 2009
Code and Slides:
                         http://thillerson.googlecode.com

      Persistence: Settings
      Yours or Apple’s?




Tuesday, March 3, 2009
Persistence: Settings

                                  Code and Slides:
                         http://thillerson.googlecode.com


                           Apple’s => Settings.bundle
                           Yours => Roll your own
                           Both end up in
                           NSUserDefaults


Tuesday, March 3, 2009
Persistence: Settings

                                  Code and Slides:
                         http://thillerson.googlecode.com
                         Can be one of:
                         NSData, NSString,
                         NSNumber, NSDate,
                         NSArray, or NSDictionary




Tuesday, March 3, 2009
Persistence: Settings

                             Code and Slides:
                    http://thillerson.googlecode.com
                  NSUserDefaults *settings =
                    [NSUserDefaults standardUserDefaults];
                  [settings setBool:YES
                    forKey:@quot;shouldSortAfterCompletequot;];
                         [NSUserDefaults standardUserDefaults];


                  [NSUserDefaults resetStandardUserDefaults];
                  BOOL on =
                    [settings
                    boolForKey:@quot;shouldSortAfterCompletequot;];




Tuesday, March 3, 2009
Code and Slides:
                         http://thillerson.googlecode.com

      Persistence: SQLite
      It’s small, but it’s feisty!




Tuesday, March 3, 2009
Persistence: SQLite

                                  Code and Slides:
                         http://thillerson.googlecode.com




            YO DAWG I HERD YOU
            LIEK DATA...
Tuesday, March 3, 2009
Persistence: SQLite

                                  Code and Slides:
                         http://thillerson.googlecode.com

                         SQLite - Embedded Relational
                         Database written in C




Tuesday, March 3, 2009
Persistence: SQLite

                                  Code and Slides:
                         http://thillerson.googlecode.com
                         Embedded Relational Database


                         written in C

Tuesday, March 3, 2009
SQLite:
                                  Code and Slides:
                                                      Hic Draconae
                         http://thillerson.googlecode.com
                                                          Sunt




                         CocoaTouch:
                         Terra Firma


Tuesday, March 3, 2009
Persistence: SQLite

                                  Code and Slides:
                         http://thillerson.googlecode.com
                         3 Takes on our Sweet App:
                         • SQLite C API
                         • fmdb + fmdb-migration-
                           manager
                         • Aptiva’s ActiveRecord


Tuesday, March 3, 2009
Persistence: SQLite

                                  Code and Slides:
                         http://thillerson.googlecode.com
                         SQL C API:
                         http://www.sqlite.org/c3ref/
                         funclist.html




Tuesday, March 3, 2009
Persistence: SQLite

                    Code and Slides:
       • fmdb - Thin Wrapper around SQLite
           http://thillerson.googlecode.com
       • fmdb-migration-manager - Rails-style
            migrations using fmdb

       • http://code.google.com/p/ ycode/
       • http://github.com/mocra/fmdb-
            migration-manager/


Tuesday, March 3, 2009
Persistence: SQLite

                                  Code and Slides:
                          • Aptiva’s ActiveRecord
                         http://thillerson.googlecode.com
           In software engineering, the active record pattern is a design
           pattern frequently found in software that stores its data in
           relational databases. It was named by Martin Fowler in his book
           Patterns of Enterprise Application Architecture.
           - http://en.wikipedia.org/wiki/Active_record_pattern

                         http://github.com/aptiva/
                         activerecord/

Tuesday, March 3, 2009
Persistence: SQLite

                                  Code and Slides:
                         http://thillerson.googlecode.com


                           Quick! To the CODES!




Tuesday, March 3, 2009
Code and Slides:
                         http://thillerson.googlecode.com

      Persistence: A Few Points
      Take two, they’re small!




Tuesday, March 3, 2009
Persistence: Tips

                                  Code and Slides:
                         http://thillerson.googlecode.com

                           Consider how your
                           settings will be used




Tuesday, March 3, 2009
Persistence: Tips

                                  Code and Slides:
                         http://thillerson.googlecode.com

                           A database is an
                           implementation detail




Tuesday, March 3, 2009
Persistence: Tips

                                  Code and Slides:
                         http://thillerson.googlecode.com

                           Encapsulation is your
                           friend




Tuesday, March 3, 2009
Persistence: Tips

                                  Code and Slides:
                         http://thillerson.googlecode.com

                           Don’t forget to move your
                           database




Tuesday, March 3, 2009
Persistence: Tips

                                  Code and Slides:
                         http://thillerson.googlecode.com
                           SQLite write speed is
                           constrained by
                           transactions




Tuesday, March 3, 2009
Persistence: Tips

                                  Code and Slides:
                         http://thillerson.googlecode.com


                           SQLite uses duck-typing




Tuesday, March 3, 2009
Persistence: Tips

                                  Code and Slides:
                         http://thillerson.googlecode.com
                           FMDB:
                           executeQuery !=
                            executeUpdate




Tuesday, March 3, 2009
Persistence: Tips

                                  Code and Slides:
                         http://thillerson.googlecode.com


                                      RTFS




Tuesday, March 3, 2009
Persistence: Thank you!
                         Tony Hillerson
                                   Code and Slides:
                         Software Architect


                          http://thillerson.googlecode.com
                     slideshare.com/thillerson
                     github.com/thillerson
                     twitter.com/thillerson
                     brightkite.com/thillerson

                     EffectiveUI.com


Tuesday, March 3, 2009

More Related Content

Viewers also liked

Identità emergenti nei pubblici connessi italiani
Identità emergenti nei pubblici connessi italianiIdentità emergenti nei pubblici connessi italiani
Identità emergenti nei pubblici connessi italianiAgnese Vellar
 
SOCIAL MEDIA: I pubblici connessi: self branding, UDC, UGC
SOCIAL MEDIA: I pubblici connessi: self branding, UDC, UGCSOCIAL MEDIA: I pubblici connessi: self branding, UDC, UGC
SOCIAL MEDIA: I pubblici connessi: self branding, UDC, UGCAgnese Vellar
 
Educare alla cittadinanza digitale: scuola e social media
Educare alla cittadinanza digitale: scuola e social mediaEducare alla cittadinanza digitale: scuola e social media
Educare alla cittadinanza digitale: scuola e social mediaGiovanni Gentili
 
Progetto Comunicazione visiva e design delle interfacce
Progetto Comunicazione visiva e design delle interfacce Progetto Comunicazione visiva e design delle interfacce
Progetto Comunicazione visiva e design delle interfacce Valentina Primiceri
 
Social Media - Introduzione al Corso [a.a. 2014-2015] - UniTo
Social Media - Introduzione al Corso [a.a. 2014-2015] - UniToSocial Media - Introduzione al Corso [a.a. 2014-2015] - UniTo
Social Media - Introduzione al Corso [a.a. 2014-2015] - UniToAgnese Vellar
 
Ways to stay connected: Harnessing, managing, and preventing context collapse...
Ways to stay connected: Harnessing, managing, and preventing context collapse...Ways to stay connected: Harnessing, managing, and preventing context collapse...
Ways to stay connected: Harnessing, managing, and preventing context collapse...Stefanie Duguay
 
19. Social network sites
19. Social network sites19. Social network sites
19. Social network sitesRoberto Polillo
 
AWS April 2016 Webinar Series - S3 Best Practices - A Decade of Field Experience
AWS April 2016 Webinar Series - S3 Best Practices - A Decade of Field ExperienceAWS April 2016 Webinar Series - S3 Best Practices - A Decade of Field Experience
AWS April 2016 Webinar Series - S3 Best Practices - A Decade of Field ExperienceAmazon Web Services
 
NLRB report of the acting general counsel concerning social media cases
NLRB report of the acting general counsel concerning social media casesNLRB report of the acting general counsel concerning social media cases
NLRB report of the acting general counsel concerning social media casesElizabeth Lupfer
 
3 Keys to Influence: Understanding and Leveraging Social Capital [whitepaper]...
3 Keys to Influence: Understanding and Leveraging Social Capital [whitepaper]...3 Keys to Influence: Understanding and Leveraging Social Capital [whitepaper]...
3 Keys to Influence: Understanding and Leveraging Social Capital [whitepaper]...Elizabeth Lupfer
 
Employee Engagement White Paper by 360Solutions
Employee Engagement White Paper by 360SolutionsEmployee Engagement White Paper by 360Solutions
Employee Engagement White Paper by 360SolutionsElizabeth Lupfer
 
Let's Talk About Social Networking
Let's Talk About Social NetworkingLet's Talk About Social Networking
Let's Talk About Social NetworkingSteve Lowisz
 
The Information Advantage - Information Access in Tomorrow's Enterprise
The Information Advantage - Information Access in Tomorrow's EnterpriseThe Information Advantage - Information Access in Tomorrow's Enterprise
The Information Advantage - Information Access in Tomorrow's EnterpriseElizabeth Lupfer
 
Gamification by Aravind Gogineni
Gamification by Aravind GogineniGamification by Aravind Gogineni
Gamification by Aravind GogineniAravind Gogineni
 
Dynamic Sound for Android
Dynamic Sound for AndroidDynamic Sound for Android
Dynamic Sound for AndroidTony Hillerson
 

Viewers also liked (20)

Identità emergenti nei pubblici connessi italiani
Identità emergenti nei pubblici connessi italianiIdentità emergenti nei pubblici connessi italiani
Identità emergenti nei pubblici connessi italiani
 
SOCIAL MEDIA: I pubblici connessi: self branding, UDC, UGC
SOCIAL MEDIA: I pubblici connessi: self branding, UDC, UGCSOCIAL MEDIA: I pubblici connessi: self branding, UDC, UGC
SOCIAL MEDIA: I pubblici connessi: self branding, UDC, UGC
 
Educare alla cittadinanza digitale: scuola e social media
Educare alla cittadinanza digitale: scuola e social mediaEducare alla cittadinanza digitale: scuola e social media
Educare alla cittadinanza digitale: scuola e social media
 
Progetto Comunicazione visiva e design delle interfacce
Progetto Comunicazione visiva e design delle interfacce Progetto Comunicazione visiva e design delle interfacce
Progetto Comunicazione visiva e design delle interfacce
 
Social Media - Introduzione al Corso [a.a. 2014-2015] - UniTo
Social Media - Introduzione al Corso [a.a. 2014-2015] - UniToSocial Media - Introduzione al Corso [a.a. 2014-2015] - UniTo
Social Media - Introduzione al Corso [a.a. 2014-2015] - UniTo
 
Ways to stay connected: Harnessing, managing, and preventing context collapse...
Ways to stay connected: Harnessing, managing, and preventing context collapse...Ways to stay connected: Harnessing, managing, and preventing context collapse...
Ways to stay connected: Harnessing, managing, and preventing context collapse...
 
19. Social network sites
19. Social network sites19. Social network sites
19. Social network sites
 
AWS April 2016 Webinar Series - S3 Best Practices - A Decade of Field Experience
AWS April 2016 Webinar Series - S3 Best Practices - A Decade of Field ExperienceAWS April 2016 Webinar Series - S3 Best Practices - A Decade of Field Experience
AWS April 2016 Webinar Series - S3 Best Practices - A Decade of Field Experience
 
Wiley
WileyWiley
Wiley
 
NLRB report of the acting general counsel concerning social media cases
NLRB report of the acting general counsel concerning social media casesNLRB report of the acting general counsel concerning social media cases
NLRB report of the acting general counsel concerning social media cases
 
3 Keys to Influence: Understanding and Leveraging Social Capital [whitepaper]...
3 Keys to Influence: Understanding and Leveraging Social Capital [whitepaper]...3 Keys to Influence: Understanding and Leveraging Social Capital [whitepaper]...
3 Keys to Influence: Understanding and Leveraging Social Capital [whitepaper]...
 
Employee Engagement White Paper by 360Solutions
Employee Engagement White Paper by 360SolutionsEmployee Engagement White Paper by 360Solutions
Employee Engagement White Paper by 360Solutions
 
Let's Talk About Social Networking
Let's Talk About Social NetworkingLet's Talk About Social Networking
Let's Talk About Social Networking
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Mytunes
MytunesMytunes
Mytunes
 
The Information Advantage - Information Access in Tomorrow's Enterprise
The Information Advantage - Information Access in Tomorrow's EnterpriseThe Information Advantage - Information Access in Tomorrow's Enterprise
The Information Advantage - Information Access in Tomorrow's Enterprise
 
Campo profughi www.asefasc.org
Campo profughi www.asefasc.orgCampo profughi www.asefasc.org
Campo profughi www.asefasc.org
 
Gamification by Aravind Gogineni
Gamification by Aravind GogineniGamification by Aravind Gogineni
Gamification by Aravind Gogineni
 
Module05
Module05Module05
Module05
 
Dynamic Sound for Android
Dynamic Sound for AndroidDynamic Sound for Android
Dynamic Sound for Android
 

Similar to iPhone Persistence For Mere Mortals

Flex Framework Smackdown
Flex Framework SmackdownFlex Framework Smackdown
Flex Framework SmackdownTony Hillerson
 
Huffduffer
HuffdufferHuffduffer
Huffdufferadactio
 
2 whats-new-in-ios7-m2-xcode-slides
2 whats-new-in-ios7-m2-xcode-slides2 whats-new-in-ios7-m2-xcode-slides
2 whats-new-in-ios7-m2-xcode-slidesMasterCode.vn
 
Beyond The Web: Drupal Meets The Desktop (And Mobile)
Beyond The Web: Drupal Meets The Desktop (And Mobile)Beyond The Web: Drupal Meets The Desktop (And Mobile)
Beyond The Web: Drupal Meets The Desktop (And Mobile)Justin Miller
 
So what's a web app? introduction to the chrome web store
So what's a web app? introduction to the chrome web storeSo what's a web app? introduction to the chrome web store
So what's a web app? introduction to the chrome web storeEric Bidelman
 
WordPress SEO - SEO-Campixx
WordPress SEO - SEO-CampixxWordPress SEO - SEO-Campixx
WordPress SEO - SEO-Campixxsteffenhd
 
Simplified Security Code Review Process
Simplified Security Code Review ProcessSimplified Security Code Review Process
Simplified Security Code Review ProcessSherif Koussa
 
Frontend tooling and workflows
Frontend tooling and workflowsFrontend tooling and workflows
Frontend tooling and workflowsDmitry Semigradsky
 

Similar to iPhone Persistence For Mere Mortals (10)

Flex Framework Smackdown
Flex Framework SmackdownFlex Framework Smackdown
Flex Framework Smackdown
 
Becoming Indie
Becoming IndieBecoming Indie
Becoming Indie
 
Huffduffer
HuffdufferHuffduffer
Huffduffer
 
2 whats-new-in-ios7-m2-xcode-slides
2 whats-new-in-ios7-m2-xcode-slides2 whats-new-in-ios7-m2-xcode-slides
2 whats-new-in-ios7-m2-xcode-slides
 
Beyond The Web: Drupal Meets The Desktop (And Mobile)
Beyond The Web: Drupal Meets The Desktop (And Mobile)Beyond The Web: Drupal Meets The Desktop (And Mobile)
Beyond The Web: Drupal Meets The Desktop (And Mobile)
 
So what's a web app? introduction to the chrome web store
So what's a web app? introduction to the chrome web storeSo what's a web app? introduction to the chrome web store
So what's a web app? introduction to the chrome web store
 
Becoming Indie
Becoming IndieBecoming Indie
Becoming Indie
 
WordPress SEO - SEO-Campixx
WordPress SEO - SEO-CampixxWordPress SEO - SEO-Campixx
WordPress SEO - SEO-Campixx
 
Simplified Security Code Review Process
Simplified Security Code Review ProcessSimplified Security Code Review Process
Simplified Security Code Review Process
 
Frontend tooling and workflows
Frontend tooling and workflowsFrontend tooling and workflows
Frontend tooling and workflows
 

More from Tony Hillerson

Totally Build Apps for Free! (not really)
Totally Build Apps for Free! (not really)Totally Build Apps for Free! (not really)
Totally Build Apps for Free! (not really)Tony Hillerson
 
Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android DevelopersTony Hillerson
 
Designing an Android App from Idea to Market
Designing an Android App from Idea to MarketDesigning an Android App from Idea to Market
Designing an Android App from Idea to MarketTony Hillerson
 
SCM for Android Developers Using Git
SCM for Android Developers Using GitSCM for Android Developers Using Git
SCM for Android Developers Using GitTony Hillerson
 
First Android Experience
First Android ExperienceFirst Android Experience
First Android ExperienceTony Hillerson
 

More from Tony Hillerson (8)

Totally Build Apps for Free! (not really)
Totally Build Apps for Free! (not really)Totally Build Apps for Free! (not really)
Totally Build Apps for Free! (not really)
 
Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android Developers
 
Designing an Android App from Idea to Market
Designing an Android App from Idea to MarketDesigning an Android App from Idea to Market
Designing an Android App from Idea to Market
 
Rails on HBase
Rails on HBaseRails on HBase
Rails on HBase
 
SCM for Android Developers Using Git
SCM for Android Developers Using GitSCM for Android Developers Using Git
SCM for Android Developers Using Git
 
Flex With Rubyamf
Flex With RubyamfFlex With Rubyamf
Flex With Rubyamf
 
First Android Experience
First Android ExperienceFirst Android Experience
First Android Experience
 
Flex And Rails
Flex And RailsFlex And Rails
Flex And Rails
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

iPhone Persistence For Mere Mortals

  • 1. Code and Slides: http://thillerson.googlecode.com iPhone Persistence Tony Hillerson For Mere Mortals Software Architect Tuesday, March 3, 2009
  • 2. Persistence Code and Slides: http://thillerson.googlecode.com Tuesday, March 3, 2009
  • 3. Persistence Code and Slides: http://thillerson.googlecode.com ... or it means saving stuff. Tuesday, March 3, 2009
  • 4. Persistence: Disclaimer Code and Slides: http://thillerson.googlecode.com BTW: I’m a n00b Tuesday, March 3, 2009
  • 5. Code and Slides: http://thillerson.googlecode.com Persistence: Savin’ stuff on ur fone Your options Tuesday, March 3, 2009
  • 6. Persistence: Options Code and Slides: http://thillerson.googlecode.com Settings SQLite Filesystem The Internets Tuesday, March 3, 2009
  • 7. Persistence: Options Code and Slides: http://thillerson.googlecode.com Settings SQLite Filesystem The Internets Tuesday, March 3, 2009
  • 8. Persistence: Our Sweet App Code and Slides: http://thillerson.googlecode.com Tuesday, March 3, 2009
  • 9. Persistence: Sweet Codes http://github.com/thillerson/grocery_getter/ Code and Slides: http://thillerson.googlecode.com Download Tuesday, March 3, 2009
  • 10. Code and Slides: http://thillerson.googlecode.com Persistence: Settings Yours or Apple’s? Tuesday, March 3, 2009
  • 11. Persistence: Settings Code and Slides: http://thillerson.googlecode.com Apple’s => Settings.bundle Yours => Roll your own Both end up in NSUserDefaults Tuesday, March 3, 2009
  • 12. Persistence: Settings Code and Slides: http://thillerson.googlecode.com Can be one of: NSData, NSString, NSNumber, NSDate, NSArray, or NSDictionary Tuesday, March 3, 2009
  • 13. Persistence: Settings Code and Slides: http://thillerson.googlecode.com NSUserDefaults *settings = [NSUserDefaults standardUserDefaults]; [settings setBool:YES forKey:@quot;shouldSortAfterCompletequot;]; [NSUserDefaults standardUserDefaults]; [NSUserDefaults resetStandardUserDefaults]; BOOL on = [settings boolForKey:@quot;shouldSortAfterCompletequot;]; Tuesday, March 3, 2009
  • 14. Code and Slides: http://thillerson.googlecode.com Persistence: SQLite It’s small, but it’s feisty! Tuesday, March 3, 2009
  • 15. Persistence: SQLite Code and Slides: http://thillerson.googlecode.com YO DAWG I HERD YOU LIEK DATA... Tuesday, March 3, 2009
  • 16. Persistence: SQLite Code and Slides: http://thillerson.googlecode.com SQLite - Embedded Relational Database written in C Tuesday, March 3, 2009
  • 17. Persistence: SQLite Code and Slides: http://thillerson.googlecode.com Embedded Relational Database written in C Tuesday, March 3, 2009
  • 18. SQLite: Code and Slides: Hic Draconae http://thillerson.googlecode.com Sunt CocoaTouch: Terra Firma Tuesday, March 3, 2009
  • 19. Persistence: SQLite Code and Slides: http://thillerson.googlecode.com 3 Takes on our Sweet App: • SQLite C API • fmdb + fmdb-migration- manager • Aptiva’s ActiveRecord Tuesday, March 3, 2009
  • 20. Persistence: SQLite Code and Slides: http://thillerson.googlecode.com SQL C API: http://www.sqlite.org/c3ref/ funclist.html Tuesday, March 3, 2009
  • 21. Persistence: SQLite Code and Slides: • fmdb - Thin Wrapper around SQLite http://thillerson.googlecode.com • fmdb-migration-manager - Rails-style migrations using fmdb • http://code.google.com/p/ ycode/ • http://github.com/mocra/fmdb- migration-manager/ Tuesday, March 3, 2009
  • 22. Persistence: SQLite Code and Slides: • Aptiva’s ActiveRecord http://thillerson.googlecode.com In software engineering, the active record pattern is a design pattern frequently found in software that stores its data in relational databases. It was named by Martin Fowler in his book Patterns of Enterprise Application Architecture. - http://en.wikipedia.org/wiki/Active_record_pattern http://github.com/aptiva/ activerecord/ Tuesday, March 3, 2009
  • 23. Persistence: SQLite Code and Slides: http://thillerson.googlecode.com Quick! To the CODES! Tuesday, March 3, 2009
  • 24. Code and Slides: http://thillerson.googlecode.com Persistence: A Few Points Take two, they’re small! Tuesday, March 3, 2009
  • 25. Persistence: Tips Code and Slides: http://thillerson.googlecode.com Consider how your settings will be used Tuesday, March 3, 2009
  • 26. Persistence: Tips Code and Slides: http://thillerson.googlecode.com A database is an implementation detail Tuesday, March 3, 2009
  • 27. Persistence: Tips Code and Slides: http://thillerson.googlecode.com Encapsulation is your friend Tuesday, March 3, 2009
  • 28. Persistence: Tips Code and Slides: http://thillerson.googlecode.com Don’t forget to move your database Tuesday, March 3, 2009
  • 29. Persistence: Tips Code and Slides: http://thillerson.googlecode.com SQLite write speed is constrained by transactions Tuesday, March 3, 2009
  • 30. Persistence: Tips Code and Slides: http://thillerson.googlecode.com SQLite uses duck-typing Tuesday, March 3, 2009
  • 31. Persistence: Tips Code and Slides: http://thillerson.googlecode.com FMDB: executeQuery != executeUpdate Tuesday, March 3, 2009
  • 32. Persistence: Tips Code and Slides: http://thillerson.googlecode.com RTFS Tuesday, March 3, 2009
  • 33. Persistence: Thank you! Tony Hillerson Code and Slides: Software Architect http://thillerson.googlecode.com slideshare.com/thillerson github.com/thillerson twitter.com/thillerson brightkite.com/thillerson EffectiveUI.com Tuesday, March 3, 2009