SlideShare a Scribd company logo
1 of 29
Топ-10 ошибок
  при разработке iPhone-приложения


                 Top 10
iPhone Application Development Mistakes


                Alexander Kaverin
    iPhone developer at Ciklum for iAgentur.ch
Section A
User Interface
1. Not following HIG



•   HIG stands for iPhone Human Interface Guidelines
    http://developer.apple.com/iphone/library/documentation/UserExperience/
    Conceptual/MobileHIG/


•   Providing a consistent visual experience has always
    been important for the Mac - so it is for iPhone
Standard controls offered by iPhone SDK
2. Overusing Interface Builder


•   Interface Builder, despite its extensive
    functionality, is not a tool to create complete visual
    design

•   IB may not contain some essential settings

•   IB is good for static interface objects. For dynamic
    objects coding is better

•   Unarchiving a .xib file is more resource-consuming
    than setting properties in code
2. Overusing Interface Builder
3. Slow responsiveness


•   Bad practice:

    •   preloading too much data in advance

    •   complex view hierarchy

    •   filling invisible areas of views

    •   displaying large lists when they are not requested

•   Memory usage also affects UI responsiveness
3. Slow responsiveness


•   Good practice:

    •   loading larger portions of data only on user’s demand

    •   you may even show an empty screen for a while before
        the data is loaded

    •   move non-UI operations to separate threads

•   Remember: the user always expects to see (almost)
    immediate reaction to his actions
Section B
Application Design
4. Relying on a fast network
              performance


•   iPhone devices can operate in Wi-Fi, 3G, EDGE and GPRS
    networks

•   Supporting only Wi-Fi network may lead to malfunctioning
    and even to AppStore rejection.
4. Relying on a fast network
               performance

If an Application requires or will have access to the cellular network, then additionally such
Application:

• Must comply with Apple's best practices and other guidelines on how Applications
  should access and use the cellular network;

• Must not in Apple's reasonable judgment excessively use or unduly burden network
  capacity or bandwidth;

• May not have Voice over Internet Protocol (VoIP) functionality using the cellular
  network.
                                                Paragraph 3.3.19 of the iPhone SDK agreement
4. Relying on a fast network
                performance
•    Solutions:

    •   Display slow connection alert.
        Use SCNetworkReachabilityGetFlags
- (BOOL)isWifiAvailable {

   BOOL wifi = NO;

   const char *host_name = "google.com";

   SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(

   
 
 
 
 
 
 
 
 
 
 
 NULL, host_name);

   SCNetworkReachabilityFlags flags;

   SCNetworkReachabilityGetFlags(reachability, &flags);

   CFRelease(reachability);

   if (flags == 2) {

   
 wifi = YES;

   }

   return wifi;
}
4. Relying on a fast network
                performance
•   Solutions:

    •   UIRequiresPersistentWiFi key in Info.plist
5. Battery life


•   Battery life and memory / CPU usage are the Apple’s
    official reasons to disallow background processes

•   Network data transfer

    •   Operations over Wi-Fi consume less power than
        operations over mobile networks

•   Inefficient usage of CoreLocation
6. Resigning active state of the
              application

•   The application becomes inactive:

    •   when accepting a call

    •   when the iPhone screen goes to sleep

•   Resetting application in this situation is not the best
    practice
Section C
Objective-C and Cocoa
7. Breaking the MVC pattern




      Model - View - Controller
8. Bad memory management
8. Bad memory management



•   iPhone Objective-C runtime, unlike Mac OS (10.5 +) does
    not support garbage collection

•   Following retain/release paradigm and maintaining object
    ownership rules is mandatory

•   Use Instruments to debug memory issues effectively
9. Retain cycle
         myView                       myDelegate


MyViewClass : UIView {         MyDelegateClass : NSObject {
  ...                            ...
  id _delegate;                  UIView *_view;
}                              }

@property (retain) delegate;   @property (retain) view;

...                            ...

- (void) dealloc {             - (void) dealloc {
  [_delegate release];           [_view release];
  ...                            ...
}                              }
9. Retain cycle
myView                 myDelegate

    1                        1
9. Retain cycle
myView                            myDelegate

    1                                   1
     self.delegate = myDelegate

     [_delegate retain]
                                        2
9. Retain cycle
myView                                      myDelegate

    1                                              1
     self.delegate = myDelegate

     [_delegate retain]
                                                   2

     myDelegate.view = self
                                  [_view retain]
    2
9. Retain cycle
                   myView                                         myDelegate

                       1                                                 1
                           self.delegate = myDelegate

                        [_delegate retain]
                                                                         2

                        myDelegate.view = self
                                                        [_view retain]
                       2


                                                                         [myDelegate release]
[myView release]

                       1                                                 1
9. Retain cycle
         myView                       myDelegate


MyViewClass : UIView {         MyDelegateClass : NSObject {
  ...                            ...
  id _delegate;                  UIView *_view;
}                              }

@property (retain) delegate;   @property (retain) view;

...                            ...

- (void) dealloc {             - (void) dealloc {
  [_delegate release];           [_view release];
  ...                            ...
}                              }
9. Retain cycle
         myView                       myDelegate


MyViewClass : UIView {         MyDelegateClass : NSObject {
  ...                            ...
  id _delegate;                  UIView *_view;
}                              }

@property (assign) delegate;   @property (retain) view;

...                            ...

- (void) dealloc {             - (void) dealloc {
  ...                            [_view release];
}                                ...
                               }
9. Retain cycle
                   myView                                          myDelegate

                       1                                                  1
                           self.delegate = myDelegate




                           myDelegate.view = self
                                                         [_view retain]
                       2
                                                                          [myDelegate release]
                                                        [_view release]
                                                                          0
                       1
[myView release]

                       0
10. Usage of private API



•   Not recommended by Apple

    •   May become a reason of rejection from the AppStore

    •   Private API may change at any OS / SDK release without
        notice
Q&A

More Related Content

Recently uploaded

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Топ-10 ошибок при разработке iPhone-приложения

  • 1. Топ-10 ошибок при разработке iPhone-приложения Top 10 iPhone Application Development Mistakes Alexander Kaverin iPhone developer at Ciklum for iAgentur.ch
  • 3. 1. Not following HIG • HIG stands for iPhone Human Interface Guidelines http://developer.apple.com/iphone/library/documentation/UserExperience/ Conceptual/MobileHIG/ • Providing a consistent visual experience has always been important for the Mac - so it is for iPhone
  • 5. 2. Overusing Interface Builder • Interface Builder, despite its extensive functionality, is not a tool to create complete visual design • IB may not contain some essential settings • IB is good for static interface objects. For dynamic objects coding is better • Unarchiving a .xib file is more resource-consuming than setting properties in code
  • 7. 3. Slow responsiveness • Bad practice: • preloading too much data in advance • complex view hierarchy • filling invisible areas of views • displaying large lists when they are not requested • Memory usage also affects UI responsiveness
  • 8. 3. Slow responsiveness • Good practice: • loading larger portions of data only on user’s demand • you may even show an empty screen for a while before the data is loaded • move non-UI operations to separate threads • Remember: the user always expects to see (almost) immediate reaction to his actions
  • 10. 4. Relying on a fast network performance • iPhone devices can operate in Wi-Fi, 3G, EDGE and GPRS networks • Supporting only Wi-Fi network may lead to malfunctioning and even to AppStore rejection.
  • 11. 4. Relying on a fast network performance If an Application requires or will have access to the cellular network, then additionally such Application: • Must comply with Apple's best practices and other guidelines on how Applications should access and use the cellular network; • Must not in Apple's reasonable judgment excessively use or unduly burden network capacity or bandwidth; • May not have Voice over Internet Protocol (VoIP) functionality using the cellular network. Paragraph 3.3.19 of the iPhone SDK agreement
  • 12. 4. Relying on a fast network performance • Solutions: • Display slow connection alert. Use SCNetworkReachabilityGetFlags - (BOOL)isWifiAvailable { BOOL wifi = NO; const char *host_name = "google.com"; SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName( NULL, host_name); SCNetworkReachabilityFlags flags; SCNetworkReachabilityGetFlags(reachability, &flags); CFRelease(reachability); if (flags == 2) { wifi = YES; } return wifi; }
  • 13. 4. Relying on a fast network performance • Solutions: • UIRequiresPersistentWiFi key in Info.plist
  • 14. 5. Battery life • Battery life and memory / CPU usage are the Apple’s official reasons to disallow background processes • Network data transfer • Operations over Wi-Fi consume less power than operations over mobile networks • Inefficient usage of CoreLocation
  • 15. 6. Resigning active state of the application • The application becomes inactive: • when accepting a call • when the iPhone screen goes to sleep • Resetting application in this situation is not the best practice
  • 17. 7. Breaking the MVC pattern Model - View - Controller
  • 18. 8. Bad memory management
  • 19. 8. Bad memory management • iPhone Objective-C runtime, unlike Mac OS (10.5 +) does not support garbage collection • Following retain/release paradigm and maintaining object ownership rules is mandatory • Use Instruments to debug memory issues effectively
  • 20. 9. Retain cycle myView myDelegate MyViewClass : UIView { MyDelegateClass : NSObject { ... ... id _delegate; UIView *_view; } } @property (retain) delegate; @property (retain) view; ... ... - (void) dealloc { - (void) dealloc { [_delegate release]; [_view release]; ... ... } }
  • 21. 9. Retain cycle myView myDelegate 1 1
  • 22. 9. Retain cycle myView myDelegate 1 1 self.delegate = myDelegate [_delegate retain] 2
  • 23. 9. Retain cycle myView myDelegate 1 1 self.delegate = myDelegate [_delegate retain] 2 myDelegate.view = self [_view retain] 2
  • 24. 9. Retain cycle myView myDelegate 1 1 self.delegate = myDelegate [_delegate retain] 2 myDelegate.view = self [_view retain] 2 [myDelegate release] [myView release] 1 1
  • 25. 9. Retain cycle myView myDelegate MyViewClass : UIView { MyDelegateClass : NSObject { ... ... id _delegate; UIView *_view; } } @property (retain) delegate; @property (retain) view; ... ... - (void) dealloc { - (void) dealloc { [_delegate release]; [_view release]; ... ... } }
  • 26. 9. Retain cycle myView myDelegate MyViewClass : UIView { MyDelegateClass : NSObject { ... ... id _delegate; UIView *_view; } } @property (assign) delegate; @property (retain) view; ... ... - (void) dealloc { - (void) dealloc { ... [_view release]; } ... }
  • 27. 9. Retain cycle myView myDelegate 1 1 self.delegate = myDelegate myDelegate.view = self [_view retain] 2 [myDelegate release] [_view release] 0 1 [myView release] 0
  • 28. 10. Usage of private API • Not recommended by Apple • May become a reason of rejection from the AppStore • Private API may change at any OS / SDK release without notice
  • 29. Q&A