Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
iPhoneアプリの通信エラー処理を考える
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
ninjinkun
January 26, 2012
Technology
4.9k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
iPhoneアプリの通信エラー処理を考える
iPhoneアプリの通信エラー処理についての考察と実装。サンプルはこちら
https://github.com/ninjinkun/AlertResume
ninjinkun
January 26, 2012
More Decks by ninjinkun
See All by ninjinkun
買収から2ヶ月でシステム統合した話
ninjinkun
0
180
Designer's and Engineer's Thinking Styles
ninjinkun
0
320
Launchable Webinar テストを効率化して生産性を上げる方法
ninjinkun
2
620
ディープリンクの 設計と実装 - iOSDC2017
ninjinkun
18
11k
スマートフォンアプリ開発における共創的な開発チーム
ninjinkun
61
19k
ReSwiftでアプリの状態管理 / Reactive Swift Meetup
ninjinkun
9
17k
フリルのアプリ開発今昔物語
ninjinkun
3
2.3k
プロトタイピング合宿によるデザインリニューアル
ninjinkun
1
3.2k
デザイナーが仕事をしやすいアプリエンジニアを考える
ninjinkun
4
760
Other Decks in Technology
See All in Technology
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
150
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
3
480
「図書館」という名前のままでいいのか -Code4Lib JAPANカンファレンス2026 アンカンファレンス報告- / Code4Lib JAPAN Conference 2026: Unconference Report
ykiyota
0
170
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
4
1.6k
深夜のクラウド懺悔室 1:29:300 or 1:0:0
kazzpapa3
1
240
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
660
家のリアーキテクト・リファクタリング
suguruooki
0
140
2026/09/10 Spring Bootから Jakarta EE/MicroProfileへの移行
megascus
0
350
20260912_スクフェス三河
kgnkhkr
0
340
Minecraft JavaのMODをSwiftで作る
1mash0
0
140
Gitは怖い?共有ワークスペースから始めるSnowflakeチーム開発
coco_se
0
200
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
680
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
Paper Plane (Part 1)
katiecoart
PRO
1
11k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.2k
Typedesign – Prime Four
hannesfritz
42
3.2k
What's in a price? How to price your products and services
michaelherold
247
13k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
380
Prompt Engineering for Job Search
mfonobong
0
450
30 Presentation Tips
portentint
PRO
1
390
Evolving SEO for Evolving Search Engines
ryanjones
0
290
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
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൛ • ΞʔϩϯŋώϨΨε, δϣʔɾίϯΣΠ