Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
iPhoneアプリの通信エラー処理を考える
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ninjinkun
January 26, 2012
Technology
3
4.8k
iPhoneアプリの通信エラー処理を考える
iPhoneアプリの通信エラー処理についての考察と実装。サンプルはこちら
https://github.com/ninjinkun/AlertResume
ninjinkun
January 26, 2012
Tweet
Share
More Decks by ninjinkun
See All by ninjinkun
買収から2ヶ月でシステム統合した話
ninjinkun
0
140
Designer's and Engineer's Thinking Styles
ninjinkun
0
280
Launchable Webinar テストを効率化して生産性を上げる方法
ninjinkun
2
590
ディープリンクの 設計と実装 - iOSDC2017
ninjinkun
18
10k
スマートフォンアプリ開発における共創的な開発チーム
ninjinkun
61
19k
ReSwiftでアプリの状態管理 / Reactive Swift Meetup
ninjinkun
9
17k
フリルのアプリ開発今昔物語
ninjinkun
3
2.3k
プロトタイピング合宿によるデザインリニューアル
ninjinkun
1
3.1k
デザイナーが仕事をしやすいアプリエンジニアを考える
ninjinkun
4
710
Other Decks in Technology
See All in Technology
AWS Bedrock Guardrails / 機密情報の入力・出力をブロックする — Blocking Sensitive Information Input/Output
kazuhitonakayama
2
180
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
14k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
95k
What's new in Go 1.26?
ciarana
2
260
ローカルでLLMを使ってみよう
kosmosebi
0
210
Lookerの最新バージョンv26.2がやばい話
waiwai2111
1
140
クラウド時代における一時権限取得
krrrr38
1
140
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
4
22k
バクラクにおける Document Understanding の挑戦:書類の「読取」から「意思決定」へ / document-understanding-in-bakuraku-2026
yuya4
0
190
AWS CDK の目玉新機能「Mixins」とは / cdk-mixins
gotok365
2
300
AI Coding Agentの地殻変動 ~ ai-coding.info の定点観測 ~
kotauchisunsun
1
490
【2026年版】生成AIによる情報システムへのインパクト
taka_aki
0
190
Featured
See All Featured
Joys of Absence: A Defence of Solitary Play
codingconduct
1
300
Why Our Code Smells
bkeepers
PRO
340
58k
First, design no harm
axbom
PRO
2
1.1k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
190
[SF Ruby Conf 2025] Rails X
palkan
2
800
What's in a price? How to price your products and services
michaelherold
247
13k
So, you think you're a good person
axbom
PRO
2
1.9k
Designing for humans not robots
tammielis
254
26k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
460
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
110
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
270
Transcript
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൛ • ΞʔϩϯŋώϨΨε, δϣʔɾίϯΣΠ