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
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
190
Designer's and Engineer's Thinking Styles
ninjinkun
0
340
Launchable Webinar テストを効率化して生産性を上げる方法
ninjinkun
2
630
ディープリンクの 設計と実装 - iOSDC2017
ninjinkun
18
11k
スマートフォンアプリ開発における共創的な開発チーム
ninjinkun
61
19k
ReSwiftでアプリの状態管理 / Reactive Swift Meetup
ninjinkun
9
18k
フリルのアプリ開発今昔物語
ninjinkun
3
2.3k
プロトタイピング合宿によるデザインリニューアル
ninjinkun
1
3.2k
デザイナーが仕事をしやすいアプリエンジニアを考える
ninjinkun
4
770
Other Decks in Technology
See All in Technology
In-Context Learning再入門。ICLの勾配降下的解釈の研究動向を追ってみる。
dai08srhg
1
340
Deep Data Security 機能解説
oracle4engineer
PRO
3
1k
生き様としてのSRE
hokkai7go
1
170
セキュリティ専任チームなしで攻撃を先回りするSREが実践したSIEM on Amazon OpenSearch Service
cscengineer
PRO
0
330
AI Agent 時代のデータ基盤: ClickHouse で実現する 超高速分析とコスト削減の両立
jozono
0
190
攻撃 3 時間 vs 復旧 10 時間。アクセスキー流出の非対称性を体感するために CTF を作った話
kazzpapa3
1
150
IBC 2026 動画技術関連レポート / IBC 2026 Report
cyberagentdevelopers
PRO
2
440
"AWSはちょっと苦手"でも大丈夫。AWS Blocks で手軽に作る Flutter のバックエンド #FlutterKaigi
tacck
PRO
0
150
Claude Codeで作ったアプリを安全に公開する/Built with Claude Japan 2026
yoshidashingo
0
170
Lint の層を組み直した話
bengo4com
3
310
Sizing, Benchmarking and Performance Tuning Apache Flink Clusters
rmetzger
0
120
現場を動かすAIエージェント#2_製造業現場でのAI活用から見た、ハマる罠と実践知
kintotechdev
2
180
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.7k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
320
How to Ace a Technical Interview
jacobian
280
24k
WCS-LA-2024
lcolladotor
0
970
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
470
Git: the NoSQL Database
bkeepers
PRO
433
67k
Navigating Team Friction
lara
192
16k
Google's AI Overviews - The New Search
badams
0
1.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3.1k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
400
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
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൛ • ΞʔϩϯŋώϨΨε, δϣʔɾίϯΣΠ