SlideShare a Scribd company logo
1 of 43
Download to read offline
High Quality iOS
                           Development


                                       @robinlu
                                       IN-SRC Studio


Saturday, April 9, 2011
Quality



Saturday, April 9, 2011
Topics
                      • Memory management
                      • Tools
                      • Crash Reports
                      • Test



Saturday, April 9, 2011
Memory Management



Saturday, April 9, 2011
Memory Management

                           alloc          object
                                   +1               -1
                           copy         reference        release
                          retain          count

                                           0

                                         dealloc



Saturday, April 9, 2011
Ownership
                          Declare ownership      Release ownership
                          • create / copy       • don’t need anymore
                          • instance variable   • dealloc of owner
                          • container
                          • multi-thread
                          • ...

Saturday, April 9, 2011
Autorelease
                      • give the ownership to autorelease pool
                      • default autorelease pool created by AppKit
                       • life cycle = event cycle
                      • You can create your own autorelease pool
                      • Don’t over use autorelease


Saturday, April 9, 2011
Problems
                      • Memory Leak
                      • Over-release




Saturday, April 9, 2011
Rules
                           You only release or autorelease
                                  objects you own
                  • If you own the object by alloc, copy or
                          retain, you have to release or autorelease
                  • If the object is not owned by you, don’t call
                          release or autorelease




Saturday, April 9, 2011
Pitfalls
                      • Implicit Onwership
                      • Circular Reference




Saturday, April 9, 2011
Implicit Ownership
                  • NSTimer
                  • Delayed performance of selector
                  • Thread
                  • IBOutlet



Saturday, April 9, 2011
Circular Reference
                          A                       A retains B
                                                  B retains C
                                                  C retains A
                  C             B


                              Break it with weak references



Saturday, April 9, 2011
General Practices
                      • Instance Variables
                      • Local Variables




Saturday, April 9, 2011
Instance Variable
            get ownership in             release ownership in
                           init                dealloc

                                           viewDidUnload
                   viewDidLoad
                                               dealloc

                                               setter
                          setter
                                               dealloc

Saturday, April 9, 2011
Local Variable

                 Always release or autorelease in the same scope




Saturday, April 9, 2011
Summary
                      • Ownership
                      • Rules
                      • Pitfalls
                      • Practices



Saturday, April 9, 2011
Analyze



Saturday, April 9, 2011
Analyze
                      • Clang Static Analyzer
                      • More powerful than compiler warnings
                      • Bug finder
                       • memory leaks
                       • dead store
                       • logic error
                       • ...
Saturday, April 9, 2011
Memory Leaks




Saturday, April 9, 2011
Potential Memory Leak




Saturday, April 9, 2011
Dead Store




         Value stored to ‘matchedRange’ during initialization is
                              never read

Saturday, April 9, 2011
Logic error




Saturday, April 9, 2011
Run Analyze




Saturday, April 9, 2011
Instruments



Saturday, April 9, 2011
Instruments
                      • Memory
                      • Performance
                      • ...




Saturday, April 9, 2011
Memory
                      • Memory Leaks
                      • Abnormal Allocation
                       • Heapshots
                      • Over Release
                       • Zombies
                      • Memory Clean up
                       • VM Tracker
Saturday, April 9, 2011
Time Profiling
                      • Sampling
                      • Record Mode
                       • Immediate mode
                       • Deferred mode



Saturday, April 9, 2011
Crash Reports



Saturday, April 9, 2011
Crash Reports

                      • What’s crash reports?
                      • Where to get crash reports?
                      • How to read crash reports?
                      • Generate crash reports by 3rd party lib

Saturday, April 9, 2011
Saturday, April 9, 2011
Xcode Organizer




                          Get crash reports from devices


Saturday, April 9, 2011
Local Directories
                      •   Mac OS X: ~/Library/Logs/CrashReporter/
                          MobileDevice/ <DEVICE_NAME>

                      •   Windows XP: C:Documents and Settings
                          <USERNAME>Application DataApple Computer
                          LogsCrashReporterMobileDevice
                          <DEVICE_NAME>

                      •   Windows Vista + 7: C:Users<USERNAME>
                          AppDataRoamingApple ComputerLogs
                          CrashReporterMobileDevice<DEVICE_NAME>



Saturday, April 9, 2011
iTunes Connect




                          Get users’ crash reports after release


Saturday, April 9, 2011
Crash Types
                  • EXC_BAD_ACCESS (SIGBUS or SIGSEGV)
                  • EXC_CRASH (SIGABRT)
                  • Low Memory
                  • 00000020
                          Exception Codes        Type
                            0x8badf00d         Timeout
                            0xdeadfa11      User Force-Quit


Saturday, April 9, 2011
Symbols
                      • Keep symbol before each release
                       • Xcode Archive
                       • dSYM file
                      • Read the report
                       • Xcode organizer
                       • atos, symbolicatecrash, symbolizecrashlog
                       • 3rd party tools - Symbolicator
Saturday, April 9, 2011
Test



Saturday, April 9, 2011
Test
                      • Unit Test
                      • Beta Test
                      • Automating UI Test




Saturday, April 9, 2011
Unit Test
                      • Unit Test Target
                      • How easy to test: M > C > V




Saturday, April 9, 2011
Automating UI Test
                      • Instruments
                      • Accessibility
                      • Javascript




Saturday, April 9, 2011
Beta Test
                      • Ad Hoc
                      • Build suggestion:
                          Ad Hoc and Distribution share the same
                          bundle id but different from Debug build




Saturday, April 9, 2011
Ad Hoc Deploy
                      • Deploy via internet
                       • Hockey
                       • TestFlightApp.com
                       • dropbox



Saturday, April 9, 2011
Crash Report Lib
                   • plcrashreporter
                    • http://code.google.com/p/plcrashreporter/
                    • can be used in both ad hoc and distribution
                            builds
                          • output as protobuf-encoded messages


Saturday, April 9, 2011
Thanks!



Saturday, April 9, 2011

More Related Content

Viewers also liked

Хостеры и регистраторы - операторы персональных данных
Хостеры и регистраторы - операторы персональных данныхХостеры и регистраторы - операторы персональных данных
Хостеры и регистраторы - операторы персональных данныхwebdrv
 
Professional Work
Professional WorkProfessional Work
Professional Workonite
 
Blocks & Grand Central Dispatch
Blocks & Grand Central DispatchBlocks & Grand Central Dispatch
Blocks & Grand Central DispatchRobin Lu
 
Greytower identity Overview
Greytower identity  OverviewGreytower identity  Overview
Greytower identity OverviewWilliam Brant
 
Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESB
Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESBGrey tower and NetIQ - Identity Manager Integration with MuleSoft ESB
Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESBWilliam Brant
 
Project Slide Show
Project Slide ShowProject Slide Show
Project Slide Showonite
 
Домен .tel - новый способ коммуникации
Домен .tel - новый способ коммуникацииДомен .tel - новый способ коммуникации
Домен .tel - новый способ коммуникацииwebdrv
 
Cocoa Design Patterns
Cocoa Design PatternsCocoa Design Patterns
Cocoa Design PatternsRobin Lu
 
Orient Advertising, Profile
Orient Advertising, ProfileOrient Advertising, Profile
Orient Advertising, ProfileHenna Shaykh
 
Khi internation food fest 2012 - for media partner
Khi internation food fest   2012 - for media partnerKhi internation food fest   2012 - for media partner
Khi internation food fest 2012 - for media partnerHenna Shaykh
 
Orient Advertising - Profile
Orient Advertising - ProfileOrient Advertising - Profile
Orient Advertising - ProfileHenna Shaykh
 
Grey tower technical capablities
Grey tower  technical capablitiesGrey tower  technical capablities
Grey tower technical capablitiesWilliam Brant
 
Symfony2 per utenti Symfony 1.x: Architettura, modelli ed esempi
Symfony2  per utenti Symfony 1.x: Architettura, modelli ed esempiSymfony2  per utenti Symfony 1.x: Architettura, modelli ed esempi
Symfony2 per utenti Symfony 1.x: Architettura, modelli ed esempiFilippo De Santis
 
Suggestions and Ideas for DigitalOcean
Suggestions and Ideas for DigitalOceanSuggestions and Ideas for DigitalOcean
Suggestions and Ideas for DigitalOceanKaan Caliskan
 
Arquitectura I Escultura Grega
Arquitectura I Escultura GregaArquitectura I Escultura Grega
Arquitectura I Escultura Gregaguestd4825b
 
Digitaalinen turvallisuus muuttuvassa ympäristössä
Digitaalinen turvallisuus muuttuvassa ympäristössäDigitaalinen turvallisuus muuttuvassa ympäristössä
Digitaalinen turvallisuus muuttuvassa ympäristössäjapijapi
 
Xkanban: XP, Kanban and timeboxing
Xkanban: XP, Kanban and timeboxingXkanban: XP, Kanban and timeboxing
Xkanban: XP, Kanban and timeboxingFilippo De Santis
 
(PFC403) Maximizing Amazon S3 Performance | AWS re:Invent 2014
(PFC403) Maximizing Amazon S3 Performance | AWS re:Invent 2014(PFC403) Maximizing Amazon S3 Performance | AWS re:Invent 2014
(PFC403) Maximizing Amazon S3 Performance | AWS re:Invent 2014Amazon Web Services
 

Viewers also liked (19)

Хостеры и регистраторы - операторы персональных данных
Хостеры и регистраторы - операторы персональных данныхХостеры и регистраторы - операторы персональных данных
Хостеры и регистраторы - операторы персональных данных
 
Professional Work
Professional WorkProfessional Work
Professional Work
 
Blocks & Grand Central Dispatch
Blocks & Grand Central DispatchBlocks & Grand Central Dispatch
Blocks & Grand Central Dispatch
 
Greytower identity Overview
Greytower identity  OverviewGreytower identity  Overview
Greytower identity Overview
 
Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESB
Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESBGrey tower and NetIQ - Identity Manager Integration with MuleSoft ESB
Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESB
 
Project Slide Show
Project Slide ShowProject Slide Show
Project Slide Show
 
Домен .tel - новый способ коммуникации
Домен .tel - новый способ коммуникацииДомен .tel - новый способ коммуникации
Домен .tel - новый способ коммуникации
 
Cocoa Design Patterns
Cocoa Design PatternsCocoa Design Patterns
Cocoa Design Patterns
 
Orient Advertising, Profile
Orient Advertising, ProfileOrient Advertising, Profile
Orient Advertising, Profile
 
Khi internation food fest 2012 - for media partner
Khi internation food fest   2012 - for media partnerKhi internation food fest   2012 - for media partner
Khi internation food fest 2012 - for media partner
 
Orient Advertising - Profile
Orient Advertising - ProfileOrient Advertising - Profile
Orient Advertising - Profile
 
Gastcollege CHE
Gastcollege CHEGastcollege CHE
Gastcollege CHE
 
Grey tower technical capablities
Grey tower  technical capablitiesGrey tower  technical capablities
Grey tower technical capablities
 
Symfony2 per utenti Symfony 1.x: Architettura, modelli ed esempi
Symfony2  per utenti Symfony 1.x: Architettura, modelli ed esempiSymfony2  per utenti Symfony 1.x: Architettura, modelli ed esempi
Symfony2 per utenti Symfony 1.x: Architettura, modelli ed esempi
 
Suggestions and Ideas for DigitalOcean
Suggestions and Ideas for DigitalOceanSuggestions and Ideas for DigitalOcean
Suggestions and Ideas for DigitalOcean
 
Arquitectura I Escultura Grega
Arquitectura I Escultura GregaArquitectura I Escultura Grega
Arquitectura I Escultura Grega
 
Digitaalinen turvallisuus muuttuvassa ympäristössä
Digitaalinen turvallisuus muuttuvassa ympäristössäDigitaalinen turvallisuus muuttuvassa ympäristössä
Digitaalinen turvallisuus muuttuvassa ympäristössä
 
Xkanban: XP, Kanban and timeboxing
Xkanban: XP, Kanban and timeboxingXkanban: XP, Kanban and timeboxing
Xkanban: XP, Kanban and timeboxing
 
(PFC403) Maximizing Amazon S3 Performance | AWS re:Invent 2014
(PFC403) Maximizing Amazon S3 Performance | AWS re:Invent 2014(PFC403) Maximizing Amazon S3 Performance | AWS re:Invent 2014
(PFC403) Maximizing Amazon S3 Performance | AWS re:Invent 2014
 

Similar to High quality iOS development

Are Your Tests Really Helping You?
Are Your Tests Really Helping You?Are Your Tests Really Helping You?
Are Your Tests Really Helping You?LB Denker
 
Atlassian RoadTrip 2011 Slide Deck
Atlassian RoadTrip 2011 Slide DeckAtlassian RoadTrip 2011 Slide Deck
Atlassian RoadTrip 2011 Slide DeckAtlassian
 
Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011Charles Nutter
 
Monitoring is easy, why are we so bad at it presentation
Monitoring is easy, why are we so bad at it  presentationMonitoring is easy, why are we so bad at it  presentation
Monitoring is easy, why are we so bad at it presentationTheo Schlossnagle
 
Puppet camp europe 2011 hackability
Puppet camp europe 2011   hackabilityPuppet camp europe 2011   hackability
Puppet camp europe 2011 hackabilityPuppet
 
Node js techtalksto
Node js techtalkstoNode js techtalksto
Node js techtalkstoJason Diller
 
Milkyway@home rcos presentation_4_8_2011
Milkyway@home rcos presentation_4_8_2011Milkyway@home rcos presentation_4_8_2011
Milkyway@home rcos presentation_4_8_2011mskmoorthy
 
The Easy Way - Plone Conference 2011
The Easy Way - Plone Conference 2011The Easy Way - Plone Conference 2011
The Easy Way - Plone Conference 2011Mikko Ohtamaa
 
Fred Spencer: Designing a Great UI
Fred Spencer: Designing a Great UIFred Spencer: Designing a Great UI
Fred Spencer: Designing a Great UIAxway Appcelerator
 
Delivering online conferences and capturing the benefits
Delivering online conferences and capturing the benefitsDelivering online conferences and capturing the benefits
Delivering online conferences and capturing the benefitsIngrid Koehler
 
Intro to Micro-frameworks
Intro to Micro-frameworksIntro to Micro-frameworks
Intro to Micro-frameworksjsmith92
 
JUDCon 2011 - Box Grinder
JUDCon 2011 - Box GrinderJUDCon 2011 - Box Grinder
JUDCon 2011 - Box GrinderFedora-Fr
 
Bonfire... How'd You Do That?! - AtlasCamp 2011
Bonfire... How'd You Do That?! - AtlasCamp 2011Bonfire... How'd You Do That?! - AtlasCamp 2011
Bonfire... How'd You Do That?! - AtlasCamp 2011Atlassian
 
You're doing it wrong
You're doing it wrongYou're doing it wrong
You're doing it wrongAdam Goucher
 
Infusion for the birds
Infusion for the birdsInfusion for the birds
Infusion for the birdscolinbdclark
 

Similar to High quality iOS development (20)

Are Your Tests Really Helping You?
Are Your Tests Really Helping You?Are Your Tests Really Helping You?
Are Your Tests Really Helping You?
 
Atlassian RoadTrip 2011 Slide Deck
Atlassian RoadTrip 2011 Slide DeckAtlassian RoadTrip 2011 Slide Deck
Atlassian RoadTrip 2011 Slide Deck
 
Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011
 
Monitoring is easy, why are we so bad at it presentation
Monitoring is easy, why are we so bad at it  presentationMonitoring is easy, why are we so bad at it  presentation
Monitoring is easy, why are we so bad at it presentation
 
Puppet camp europe 2011 hackability
Puppet camp europe 2011   hackabilityPuppet camp europe 2011   hackability
Puppet camp europe 2011 hackability
 
Node js techtalksto
Node js techtalkstoNode js techtalksto
Node js techtalksto
 
Milkyway@home rcos presentation_4_8_2011
Milkyway@home rcos presentation_4_8_2011Milkyway@home rcos presentation_4_8_2011
Milkyway@home rcos presentation_4_8_2011
 
agile-planning
agile-planningagile-planning
agile-planning
 
Namesmatter
NamesmatterNamesmatter
Namesmatter
 
The Easy Way - Plone Conference 2011
The Easy Way - Plone Conference 2011The Easy Way - Plone Conference 2011
The Easy Way - Plone Conference 2011
 
Fred Spencer: Designing a Great UI
Fred Spencer: Designing a Great UIFred Spencer: Designing a Great UI
Fred Spencer: Designing a Great UI
 
Delivering online conferences and capturing the benefits
Delivering online conferences and capturing the benefitsDelivering online conferences and capturing the benefits
Delivering online conferences and capturing the benefits
 
Beyond Page Objects
Beyond Page ObjectsBeyond Page Objects
Beyond Page Objects
 
Extending rails
Extending railsExtending rails
Extending rails
 
Intro to Micro-frameworks
Intro to Micro-frameworksIntro to Micro-frameworks
Intro to Micro-frameworks
 
JUDCon 2011 - Box Grinder
JUDCon 2011 - Box GrinderJUDCon 2011 - Box Grinder
JUDCon 2011 - Box Grinder
 
Bonfire... How'd You Do That?! - AtlasCamp 2011
Bonfire... How'd You Do That?! - AtlasCamp 2011Bonfire... How'd You Do That?! - AtlasCamp 2011
Bonfire... How'd You Do That?! - AtlasCamp 2011
 
You're doing it wrong
You're doing it wrongYou're doing it wrong
You're doing it wrong
 
obs-tdd-intro
obs-tdd-introobs-tdd-intro
obs-tdd-intro
 
Infusion for the birds
Infusion for the birdsInfusion for the birds
Infusion for the birds
 

Recently uploaded

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Recently uploaded (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

High quality iOS development

  • 1. High Quality iOS Development @robinlu IN-SRC Studio Saturday, April 9, 2011
  • 3. Topics • Memory management • Tools • Crash Reports • Test Saturday, April 9, 2011
  • 5. Memory Management alloc object +1 -1 copy reference release retain count 0 dealloc Saturday, April 9, 2011
  • 6. Ownership Declare ownership Release ownership • create / copy • don’t need anymore • instance variable • dealloc of owner • container • multi-thread • ... Saturday, April 9, 2011
  • 7. Autorelease • give the ownership to autorelease pool • default autorelease pool created by AppKit • life cycle = event cycle • You can create your own autorelease pool • Don’t over use autorelease Saturday, April 9, 2011
  • 8. Problems • Memory Leak • Over-release Saturday, April 9, 2011
  • 9. Rules You only release or autorelease objects you own • If you own the object by alloc, copy or retain, you have to release or autorelease • If the object is not owned by you, don’t call release or autorelease Saturday, April 9, 2011
  • 10. Pitfalls • Implicit Onwership • Circular Reference Saturday, April 9, 2011
  • 11. Implicit Ownership • NSTimer • Delayed performance of selector • Thread • IBOutlet Saturday, April 9, 2011
  • 12. Circular Reference A A retains B B retains C C retains A C B Break it with weak references Saturday, April 9, 2011
  • 13. General Practices • Instance Variables • Local Variables Saturday, April 9, 2011
  • 14. Instance Variable get ownership in release ownership in init dealloc viewDidUnload viewDidLoad dealloc setter setter dealloc Saturday, April 9, 2011
  • 15. Local Variable Always release or autorelease in the same scope Saturday, April 9, 2011
  • 16. Summary • Ownership • Rules • Pitfalls • Practices Saturday, April 9, 2011
  • 18. Analyze • Clang Static Analyzer • More powerful than compiler warnings • Bug finder • memory leaks • dead store • logic error • ... Saturday, April 9, 2011
  • 21. Dead Store Value stored to ‘matchedRange’ during initialization is never read Saturday, April 9, 2011
  • 25. Instruments • Memory • Performance • ... Saturday, April 9, 2011
  • 26. Memory • Memory Leaks • Abnormal Allocation • Heapshots • Over Release • Zombies • Memory Clean up • VM Tracker Saturday, April 9, 2011
  • 27. Time Profiling • Sampling • Record Mode • Immediate mode • Deferred mode Saturday, April 9, 2011
  • 29. Crash Reports • What’s crash reports? • Where to get crash reports? • How to read crash reports? • Generate crash reports by 3rd party lib Saturday, April 9, 2011
  • 31. Xcode Organizer Get crash reports from devices Saturday, April 9, 2011
  • 32. Local Directories • Mac OS X: ~/Library/Logs/CrashReporter/ MobileDevice/ <DEVICE_NAME> • Windows XP: C:Documents and Settings <USERNAME>Application DataApple Computer LogsCrashReporterMobileDevice <DEVICE_NAME> • Windows Vista + 7: C:Users<USERNAME> AppDataRoamingApple ComputerLogs CrashReporterMobileDevice<DEVICE_NAME> Saturday, April 9, 2011
  • 33. iTunes Connect Get users’ crash reports after release Saturday, April 9, 2011
  • 34. Crash Types • EXC_BAD_ACCESS (SIGBUS or SIGSEGV) • EXC_CRASH (SIGABRT) • Low Memory • 00000020 Exception Codes Type 0x8badf00d Timeout 0xdeadfa11 User Force-Quit Saturday, April 9, 2011
  • 35. Symbols • Keep symbol before each release • Xcode Archive • dSYM file • Read the report • Xcode organizer • atos, symbolicatecrash, symbolizecrashlog • 3rd party tools - Symbolicator Saturday, April 9, 2011
  • 37. Test • Unit Test • Beta Test • Automating UI Test Saturday, April 9, 2011
  • 38. Unit Test • Unit Test Target • How easy to test: M > C > V Saturday, April 9, 2011
  • 39. Automating UI Test • Instruments • Accessibility • Javascript Saturday, April 9, 2011
  • 40. Beta Test • Ad Hoc • Build suggestion: Ad Hoc and Distribution share the same bundle id but different from Debug build Saturday, April 9, 2011
  • 41. Ad Hoc Deploy • Deploy via internet • Hockey • TestFlightApp.com • dropbox Saturday, April 9, 2011
  • 42. Crash Report Lib • plcrashreporter • http://code.google.com/p/plcrashreporter/ • can be used in both ad hoc and distribution builds • output as protobuf-encoded messages Saturday, April 9, 2011