SlideShare a Scribd company logo
1 of 21
Download to read offline
iPhone
         id:ninjinkun / @ninjinkun
•            iOS Advent Calendar

    •   25

    •   http://atnd.org/events/22792
    •   http://ninjinkun.hatenablog.com/entry/2011/12/23/224918
•
•
•
•           IO→

    •                    etc…

•           IO→

•   iPhone

    •
        •         etc…

    •
•   …
•   …
•   Mail
•   Instagram
•   Facebook
•   Path
Mail

 •
 •

       •   OS

 •
 •
Instagram

 •
 •
     •
 •
 •
Facebook

 •
 •
Path

 •
 •
 •     POST / GET   (?)

 •
 •
 •                    …
•
    •   UIAlertView
•
    •   UIViewController

    •
    https://github.com/ninjinkun/AlertResume
•   UIAlertView
•   NSError

•   NSAlertView   NSError


    •   …
•   NSError


•       userInfo


•   localizedDiscription
•   localizedFailureReason
•   localizedRecoverySuggestion
•   localizedRecoveryOptions
NSArray *buttons = [NSArray arrayWithObjects:@"        ", @"        ", nil];
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
                          @"                           ", NSLocalizedDescriptionKey,
                          @”                       ”, NSLocalizedFailureReasonErrorKey,
                          @"           …", NSLocalizedRecoverySuggestionErrorKey,
                          buttons, NSLocalizedRecoveryOptionsErrorKey,
                          nil];
NSError*error = [NSError errorWithDomain:@"com.hoge.fuga" code:100 userInfo:userInfo];
•    UIAlertView
@implementation UIAlertView (NSErrorAddition)

-(id)initWithError:(NSError *)error {
    self = [super init];
    if (self) {
        self.title = [error localizedDescription];
        self.message = [[NSArray arrayWithObjects:[error localizedFailureReason],
            [error localizedRecoverySuggestion], nil] componentsJoinedByString:@"n"];
        NSArray* optionTitles = [error localizedRecoveryOptions];
        for (NSString *title in optionTitles) {
            [self addButtonWithTitle:title];
        }
    }
    return self;
}

@end
•   ViewController

    •   POST

    •
•                    ViewController
•
    •
    •
    •
•
•
    •
•
    •   Path

•
    •   UIAlertView
    •                 2

•
•   iOS       2

    •     ,

More Related Content

What's hot

Интуит. Разработка приложений для iOS. Лекция 11. Расширенные возможности уст...
Интуит. Разработка приложений для iOS. Лекция 11. Расширенные возможности уст...Интуит. Разработка приложений для iOS. Лекция 11. Расширенные возможности уст...
Интуит. Разработка приложений для iOS. Лекция 11. Расширенные возможности уст...
Глеб Тарасов
 
Corporate Council on Africa Infrastructure Conference, Washington, DC, Septem...
Corporate Council on Africa Infrastructure Conference, Washington, DC, Septem...Corporate Council on Africa Infrastructure Conference, Washington, DC, Septem...
Corporate Council on Africa Infrastructure Conference, Washington, DC, Septem...
lucamazzei
 

What's hot (13)

OE 42 boycott of virani moti's shantidas bapu for pro satpanth activities
OE 42  boycott of virani moti's shantidas bapu for pro satpanth activitiesOE 42  boycott of virani moti's shantidas bapu for pro satpanth activities
OE 42 boycott of virani moti's shantidas bapu for pro satpanth activities
 
Migrare da symfony 1 a Symfony2
 Migrare da symfony 1 a Symfony2  Migrare da symfony 1 a Symfony2
Migrare da symfony 1 a Symfony2
 
Whatisspider
WhatisspiderWhatisspider
Whatisspider
 
Crowdsourcing with Django
Crowdsourcing with DjangoCrowdsourcing with Django
Crowdsourcing with Django
 
If songs were lines in a conversation. Nick Drake
If songs were lines in a conversation. Nick DrakeIf songs were lines in a conversation. Nick Drake
If songs were lines in a conversation. Nick Drake
 
Blog Indiana09
Blog Indiana09Blog Indiana09
Blog Indiana09
 
Importance of ipad stands that seem trivial
Importance of ipad stands that seem trivialImportance of ipad stands that seem trivial
Importance of ipad stands that seem trivial
 
Интуит. Разработка приложений для iOS. Лекция 11. Расширенные возможности уст...
Интуит. Разработка приложений для iOS. Лекция 11. Расширенные возможности уст...Интуит. Разработка приложений для iOS. Лекция 11. Расширенные возможности уст...
Интуит. Разработка приложений для iOS. Лекция 11. Расширенные возможности уст...
 
Erik mogensen stowe
Erik mogensen stoweErik mogensen stowe
Erik mogensen stowe
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbai
 
When solid met angular components
When solid met angular componentsWhen solid met angular components
When solid met angular components
 
Corporate Council on Africa Infrastructure Conference, Washington, DC, Septem...
Corporate Council on Africa Infrastructure Conference, Washington, DC, Septem...Corporate Council on Africa Infrastructure Conference, Washington, DC, Septem...
Corporate Council on Africa Infrastructure Conference, Washington, DC, Septem...
 
A piece of sugar in your client-side development
A piece of sugar in your client-side developmentA piece of sugar in your client-side development
A piece of sugar in your client-side development
 

Viewers also liked

Amazon ElastiCache - AWSマイスターシリーズ
Amazon ElastiCache - AWSマイスターシリーズAmazon ElastiCache - AWSマイスターシリーズ
Amazon ElastiCache - AWSマイスターシリーズ
SORACOM, INC
 

Viewers also liked (8)

HTML5最新動向
HTML5最新動向HTML5最新動向
HTML5最新動向
 
NTT研究所におけるYammerの取り組みと、社内Twitterの統計解析
NTT研究所におけるYammerの取り組みと、社内Twitterの統計解析NTT研究所におけるYammerの取り組みと、社内Twitterの統計解析
NTT研究所におけるYammerの取り組みと、社内Twitterの統計解析
 
HTML5とはなにか?マイクロソフトはHTML5をどう考えているのか?
HTML5とはなにか?マイクロソフトはHTML5をどう考えているのか?HTML5とはなにか?マイクロソフトはHTML5をどう考えているのか?
HTML5とはなにか?マイクロソフトはHTML5をどう考えているのか?
 
ソーシャルゲームにおけるMongoDB適用事例 - Animal Land
ソーシャルゲームにおけるMongoDB適用事例 - Animal LandソーシャルゲームにおけるMongoDB適用事例 - Animal Land
ソーシャルゲームにおけるMongoDB適用事例 - Animal Land
 
Metro#1
Metro#1Metro#1
Metro#1
 
Amazon ElastiCache - AWSマイスターシリーズ
Amazon ElastiCache - AWSマイスターシリーズAmazon ElastiCache - AWSマイスターシリーズ
Amazon ElastiCache - AWSマイスターシリーズ
 
Web Intents入門
Web Intents入門Web Intents入門
Web Intents入門
 
Process Framework「CYCLONE for Mobile Apps」(20120118)
Process Framework「CYCLONE for Mobile Apps」(20120118)Process Framework「CYCLONE for Mobile Apps」(20120118)
Process Framework「CYCLONE for Mobile Apps」(20120118)
 

Similar to I phoneアプリの通信エラー処理

ARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマーARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマー
Satoshi Asano
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
Petr Dvorak
 
Objective-C Survives
Objective-C SurvivesObjective-C Survives
Objective-C Survives
S Akai
 
Symfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worldsSymfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worlds
Ignacio Martín
 
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみたスマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
Taro Matsuzawa
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
Petr Dvorak
 

Similar to I phoneアプリの通信エラー処理 (20)

ARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマーARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマー
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
 
iPhone dev intro
iPhone dev introiPhone dev intro
iPhone dev intro
 
Beginning to iPhone development
Beginning to iPhone developmentBeginning to iPhone development
Beginning to iPhone development
 
Objective-C Survives
Objective-C SurvivesObjective-C Survives
Objective-C Survives
 
コードで学ぶドメイン駆動設計入門
コードで学ぶドメイン駆動設計入門コードで学ぶドメイン駆動設計入門
コードで学ぶドメイン駆動設計入門
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applications
 
Symfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worldsSymfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worlds
 
Objective-C Crash Course for Web Developers
Objective-C Crash Course for Web DevelopersObjective-C Crash Course for Web Developers
Objective-C Crash Course for Web Developers
 
Thinking Outside The [Sand]Box
Thinking Outside The [Sand]BoxThinking Outside The [Sand]Box
Thinking Outside The [Sand]Box
 
Google Analytics & iPhone
Google Analytics & iPhoneGoogle Analytics & iPhone
Google Analytics & iPhone
 
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみたスマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
 
Try EarlGrey | 20161118 iOS Test Night
Try EarlGrey | 20161118 iOS Test NightTry EarlGrey | 20161118 iOS Test Night
Try EarlGrey | 20161118 iOS Test Night
 
Selenium再入門
Selenium再入門Selenium再入門
Selenium再入門
 
Modernizes your objective C - Oliviero
Modernizes your objective C - OlivieroModernizes your objective C - Oliviero
Modernizes your objective C - Oliviero
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5
 
Freebase and the iPhone
Freebase and the iPhoneFreebase and the iPhone
Freebase and the iPhone
 
Object oriented programming in C++
Object oriented programming in C++Object oriented programming in C++
Object oriented programming in C++
 

More from Satoshi Asano (8)

GitHub活動を通して個人のキャリアを積みつつ仕事の成果を出す方法
GitHub活動を通して個人のキャリアを積みつつ仕事の成果を出す方法GitHub活動を通して個人のキャリアを積みつつ仕事の成果を出す方法
GitHub活動を通して個人のキャリアを積みつつ仕事の成果を出す方法
 
iPhoneアプリとAndroidアプリを比較する〜はてなブックマーク開発の現場から〜
iPhoneアプリとAndroidアプリを比較する〜はてなブックマーク開発の現場から〜iPhoneアプリとAndroidアプリを比較する〜はてなブックマーク開発の現場から〜
iPhoneアプリとAndroidアプリを比較する〜はてなブックマーク開発の現場から〜
 
iPhoneアプリ開発講座Web連携アプリ編
iPhoneアプリ開発講座Web連携アプリ編iPhoneアプリ開発講座Web連携アプリ編
iPhoneアプリ開発講座Web連携アプリ編
 
Asihttp requestについて
Asihttp requestについてAsihttp requestについて
Asihttp requestについて
 
バックグラウンド位置取得について
バックグラウンド位置取得についてバックグラウンド位置取得について
バックグラウンド位置取得について
 
iPhoneアプリ開発講座入門編
iPhoneアプリ開発講座入門編iPhoneアプリ開発講座入門編
iPhoneアプリ開発講座入門編
 
集合知プログラミング第2章復習
集合知プログラミング第2章復習集合知プログラミング第2章復習
集合知プログラミング第2章復習
 
Algorithm Introduction #18 B-Tree
Algorithm Introduction #18 B-TreeAlgorithm Introduction #18 B-Tree
Algorithm Introduction #18 B-Tree
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

I phoneアプリの通信エラー処理

  • 1. iPhone id:ninjinkun / @ninjinkun
  • 2. iOS Advent Calendar • 25 • http://atnd.org/events/22792 • http://ninjinkun.hatenablog.com/entry/2011/12/23/224918
  • 4. IO→ • etc… • IO→ • iPhone • • etc… •
  • 5.
  • 6.
  • 7.
  • 8. Mail • Instagram • Facebook • Path
  • 9. Mail • • • OS • •
  • 10. Instagram • • • • •
  • 12. Path • • • POST / GET (?) • • • …
  • 13. • UIAlertView • • UIViewController • https://github.com/ninjinkun/AlertResume
  • 14. UIAlertView • NSError • NSAlertView NSError • …
  • 15. NSError • userInfo • localizedDiscription • localizedFailureReason • localizedRecoverySuggestion • localizedRecoveryOptions
  • 16. NSArray *buttons = [NSArray arrayWithObjects:@" ", @" ", nil]; NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: @" ", NSLocalizedDescriptionKey, @” ”, NSLocalizedFailureReasonErrorKey, @" …", NSLocalizedRecoverySuggestionErrorKey, buttons, NSLocalizedRecoveryOptionsErrorKey, nil]; NSError*error = [NSError errorWithDomain:@"com.hoge.fuga" code:100 userInfo:userInfo];
  • 17. UIAlertView @implementation UIAlertView (NSErrorAddition) -(id)initWithError:(NSError *)error { self = [super init]; if (self) { self.title = [error localizedDescription]; self.message = [[NSArray arrayWithObjects:[error localizedFailureReason], [error localizedRecoverySuggestion], nil] componentsJoinedByString:@"n"]; NSArray* optionTitles = [error localizedRecoveryOptions]; for (NSString *title in optionTitles) { [self addButtonWithTitle:title]; } } return self; } @end
  • 18. ViewController • POST • • ViewController
  • 19. • • • •
  • 20. • • • Path • • UIAlertView • 2 •
  • 21. iOS 2 • ,