I phoneアプリの通信エラー処理
Upcoming SlideShare
Loading in...5
×
 

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

on

  • 4,412 views

 

Statistics

Views

Total Views
4,412
Views on SlideShare
1,729
Embed Views
2,683

Actions

Likes
4
Downloads
6
Comments
0

4 Embeds 2,683

http://www.atmarkit.co.jp 2660
http://aitcms-w.atmarkit.co.jp 9
http://www.fujico.co.jp 9
http://webcache.googleusercontent.com 5

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

I phoneアプリの通信エラー処理 I phoneアプリの通信エラー処理 Presentation 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 • ,