[from now] 2012/09/03 03:28:31

diff --git a/skooma/CCAppDelegate.m b/skooma/CCAppDelegate.m
index cb531c4..986d255 100644
--- a/skooma/CCAppDelegate.m
+++ b/skooma/CCAppDelegate.m
@@ -24,7 +24,7 @@ CCIcon          *icon = nil;
         sound = [CCSound new];
         icon  = [CCIcon new];

-        _rect = [[UIScreen mainScreen] bounds];
+        self.rect = [[UIScreen mainScreen] bounds];
     }
     return self;
 }
@@ -41,7 +41,7 @@ CCIcon          *icon = nil;
     label.frame = CGRectMake(30, 30, 280, 300);
     label.font = [UIFont fontWithName:@"azuki_font" size:60];
     label.text = @"あいうえおかきくけこ";
-    [_window addSubview:label];
+    [self.window addSubview:label];

 //    NSURL *url = [NSURL URLWithString:@"http://img.2chan.net/b/futaba.php?mode=cat&cxyl=100x100x256"];
 //    NSURL *url = [NSURL URLWithString:@"http://img.2chan.net/b/res/163322977.htm"];
@@ -120,7 +120,7 @@ CCIcon          *icon = nil;
     threadViewController = [[CCThreadViewController alloc] initWithStyle:UITableViewStylePlain];
     [self.window addSubview:threadViewController.view];
     [self.window makeKeyAndVisible];
-
+
     return YES;
 }

@@ -162,21 +162,21 @@ CCIcon          *icon = nil;
 - (id)init
 {
     if (self = [super init]) {
-        _clear     = [UIColor clearColor];
-        _white     = [UIColor whiteColor];
-        _lightGray = [UIColor lightGrayColor];
-        _gray      = [UIColor grayColor];
-        _darkGray  = [UIColor darkGrayColor];
-        _black     = [UIColor blackColor];
-        _smoke     = [UIColor colorWithWhite:0.00 alpha:0.50];
-
-        _time       = [UIColor colorWithRed:0.75 green:0.50 blue:0.43 alpha:1];
-        _title      = [UIColor colorWithRed:0.82 green:0.06 blue:0.02 alpha:1];
-        _name       = [UIColor colorWithRed:0.06 green:0.44 blue:0.25 alpha:1];
-        _mail       = [UIColor colorWithRed:0.00 green:0.00 blue:0.80 alpha:1];
-        _resCount   = [UIColor colorWithRed:0.06 green:0.44 blue:0.25 alpha:1];
-        _text       = [UIColor colorWithRed:0.50 green:0.00 blue:0.00 alpha:1];
-        _quote      = [UIColor colorWithRed:0.47 green:0.60 blue:0.13 alpha:1];
+        self.clear     = [UIColor clearColor];
+        self.white     = [UIColor whiteColor];
+        self.lightGray = [UIColor lightGrayColor];
+        self.gray      = [UIColor grayColor];
+        self.darkGray  = [UIColor darkGrayColor];
+        self.black     = [UIColor blackColor];
+        self.smoke     = [UIColor colorWithWhite:0.00 alpha:0.50];
+
+        self.time       = [UIColor colorWithRed:0.75 green:0.50 blue:0.43 alpha:1];
+        self.title      = [UIColor colorWithRed:0.82 green:0.06 blue:0.02 alpha:1];
+        self.name       = [UIColor colorWithRed:0.06 green:0.44 blue:0.25 alpha:1];
+        self.mail       = [UIColor colorWithRed:0.00 green:0.00 blue:0.80 alpha:1];
+        self.resCount   = [UIColor colorWithRed:0.06 green:0.44 blue:0.25 alpha:1];
+        self.text       = [UIColor colorWithRed:0.50 green:0.00 blue:0.00 alpha:1];
+        self.quote      = [UIColor colorWithRed:0.47 green:0.60 blue:0.13 alpha:1];
     }
     return self;
 }
@@ -193,7 +193,7 @@ CCIcon          *icon = nil;
 {
     self = [super init];
     if (self) {
-
+
     }
     return self;
 }
@@ -210,7 +210,7 @@ CCIcon          *icon = nil;
 {
     self = [super init];
     if (self) {
-
+
     }
     return self;
 }
diff --git a/skooma/CCSwipableCell.h b/skooma/CCSwipableCell.h
index 7466060..3ab507c 100644
--- a/skooma/CCSwipableCell.h
+++ b/skooma/CCSwipableCell.h
@@ -11,10 +11,10 @@
 @class CCSwipableCell;

 typedef enum {
-    SwipeDirectionRight = 0,
-    SwipeDirectionLeft,
-    SwipeDirectionBoth,
-    SwipeDirectionNone,
+    CCSwipeDirectionRight = 0,
+    CCSwipeDirectionLeft,
+    CCSwipeDirectionBoth,
+    CCSwipeDirectionNone,
 } CCSwipeDirection;

 @protocol CCSwipableCellDelegate <NSObject>
diff --git a/skooma/CCSwipableCell.m b/skooma/CCSwipableCell.m
index f24a2bd..dc981c9 100644
--- a/skooma/CCSwipableCell.m
+++ b/skooma/CCSwipableCell.m
@@ -18,8 +18,6 @@
 {
     self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
     if (self) {
-        self.swipeDirection = SwipeDirectionRight;
-
         UIView *defaultBackgroundView = [[UIView  alloc] initWithFrame:self.contentView.frame];
         defaultBackgroundView.backgroundColor = [UIColor darkGrayColor];
         self.backgroundView = defaultBackgroundView;
@@ -29,9 +27,9 @@

 - (void)handleSwipe:(UISwipeGestureRecognizer *)gesture
 {
-    _lastGestureRecognized = gesture;
+    self.lastGestureRecognized = gesture;
     [self slideOutContentView];
-    [_delegate cellDidReceiveSwipe:self];
+    [self.delegate cellDidReceiveSwipe:self];
 }

 - (void)setSwipeDirection:(CCSwipeDirection)direction
@@ -44,13 +42,13 @@
     }

     switch (_swipeDirection) {
-        case SwipeDirectionLeft:
+        case CCSwipeDirectionLeft:
             [self addSwipeGestureRecognizer:UISwipeGestureRecognizerDirectionLeft];
             break;
-        case SwipeDirectionRight:
+        case CCSwipeDirectionRight:
             [self addSwipeGestureRecognizer:UISwipeGestureRecognizerDirectionRight];
             break;
-        case SwipeDirectionBoth:
+        case CCSwipeDirectionBoth:
             [self addSwipeGestureRecognizer:UISwipeGestureRecognizerDirectionLeft];
             [self addSwipeGestureRecognizer:UISwipeGestureRecognizerDirectionRight];
         default:
@@ -79,7 +77,7 @@ void LR_offsetView(UIView *view, CGFloat offsetX, CGFloat offsetY)
 {
     CGFloat offsetX;

-    switch (_lastGestureRecognized.direction) {
+    switch (self.lastGestureRecognized.direction) {
         case UISwipeGestureRecognizerDirectionLeft:
             offsetX = -self.contentView.frame.size.width;
             break;
@@ -87,7 +85,9 @@ void LR_offsetView(UIView *view, CGFloat offsetX, CGFloat offsetY)
             offsetX = self.contentView.frame.size.width;
             break;
         default:
-            @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Unhandled gesture direction" userInfo:[NSDictionary dictionaryWithObject:self.lastGestureRecognized forKey:@"lastGestureRecognized"]];
+            @throw [NSException exceptionWithName:NSInternalInconsistencyException
+                                           reason:@"Unhandled gesture direction"
+                                         userInfo:[NSDictionary dictionaryWithObject:self.lastGestureRecognized forKey:@"lastGestureRecognized"]];
             break;
     }

@@ -112,7 +112,9 @@ void LR_offsetView(UIView *view, CGFloat offsetX, CGFloat offsetY)
             bounceDistance = kBOUNCE_DISTANCE;
             break;
         default:
-            @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Unhandled gesture direction" userInfo:[NSDictionary dictionaryWithObject:self.lastGestureRecognized forKey:@"lastGestureRecognized"]];
+            @throw [NSException exceptionWithName:NSInternalInconsistencyException
+                                           reason:@"Unhandled gesture direction"
+                                         userInfo:[NSDictionary dictionaryWithObject:self.lastGestureRecognized forKey:@"lastGestureRecognized"]];
             break;
     }

diff --git a/skooma/CCThread.m b/skooma/CCThread.m
index 7a422d6..42814ff 100644
--- a/skooma/CCThread.m
+++ b/skooma/CCThread.m
@@ -14,18 +14,18 @@
 {
     self = [super init];
     if (self) {
-        _lines         = [NSMutableArray array];
-        _boardId       = [[dictionary objectForKey:@"board_id"] intValue];
-        _number        = [[dictionary objectForKey:@"number"] intValue];
-        _lastResNumber = [[dictionary objectForKey:@"last_res_number"] intValue];
-        _resCount      = [[dictionary objectForKey:@"res_count"] intValue];
-        _is404         = [[dictionary objectForKey:@"is_404"] intValue];
-        _thumbnail     = [dictionary objectForKey:@"thumbnail"];
-        _src           = [dictionary objectForKey:@"src"];
-        _title         = [dictionary objectForKey:@"title"];
-        _name          = [dictionary objectForKey:@"name"];
-        _mail          = [dictionary objectForKey:@"mail"];
-        _text          = [NSMutableString stringWithString:[dictionary objectForKey:@"text"]];
+        self.lines         = [NSMutableArray array];
+        self.boardId       = [[dictionary objectForKey:@"board_id"] intValue];
+        self.number        = [[dictionary objectForKey:@"number"] intValue];
+        self.lastResNumber = [[dictionary objectForKey:@"last_res_number"] intValue];
+        self.resCount      = [[dictionary objectForKey:@"res_count"] intValue];
+        self.is404         = [[dictionary objectForKey:@"is_404"] intValue];
+        self.thumbnail     = [dictionary objectForKey:@"thumbnail"];
+        self.src           = [dictionary objectForKey:@"src"];
+        self.title         = [dictionary objectForKey:@"title"];
+        self.name          = [dictionary objectForKey:@"name"];
+        self.mail          = [dictionary objectForKey:@"mail"];
+        self.text          = [NSMutableString stringWithString:[dictionary objectForKey:@"text"]];

         [self coordinate];
     }
@@ -40,17 +40,17 @@
 - (NSDictionary *)dictionary
 {
 	NSMutableDictionary *dictionary = [NSMutableDictionary new];
-	[dictionary setObject:[NSNumber numberWithInt:_boardId] forKey:@"board_id"];
-	[dictionary setObject:[NSNumber numberWithInt:_number] forKey:@"number"];
-	[dictionary setObject:[NSNumber numberWithInt:_lastResNumber] forKey:@"last_res_number"];
-	[dictionary setObject:[NSNumber numberWithInt:_resCount] forKey:@"res_count"];
-	[dictionary setObject:[NSNumber numberWithInt:_is404] forKey:@"is_404"];
-	[dictionary setObject:_thumbnail forKey:@"thumbnail"];
-	[dictionary setObject:_src forKey:@"src"];
-	[dictionary setObject:_title forKey:@"title"];
-	[dictionary setObject:_name forKey:@"name"];
-	[dictionary setObject:_mail forKey:@"mail"];
-	[dictionary setObject:_text forKey:@"text"];
+	[dictionary setObject:[NSNumber numberWithInt:self.boardId] forKey:@"board_id"];
+	[dictionary setObject:[NSNumber numberWithInt:self.number] forKey:@"number"];
+	[dictionary setObject:[NSNumber numberWithInt:self.lastResNumber] forKey:@"last_res_number"];
+	[dictionary setObject:[NSNumber numberWithInt:self.resCount] forKey:@"res_count"];
+	[dictionary setObject:[NSNumber numberWithInt:self.is404] forKey:@"is_404"];
+	[dictionary setObject:self.thumbnail forKey:@"thumbnail"];
+	[dictionary setObject:self.src forKey:@"src"];
+	[dictionary setObject:self.title forKey:@"title"];
+	[dictionary setObject:self.name forKey:@"name"];
+	[dictionary setObject:self.mail forKey:@"mail"];
+	[dictionary setObject:self.text forKey:@"text"];
 	return dictionary;
 }

@@ -66,50 +66,50 @@

 - (void)coordinate
 {
-	[_text replaceOccurrencesOfString:@"<font color=\"#789922\">" withString:@""   options:0 range:NSMakeRange(0, [_text length])];
-	[_text replaceOccurrencesOfString:@"</font>"                  withString:@""   options:0 range:NSMakeRange(0, [_text length])];
-	[_text replaceOccurrencesOfString:@"&gt;"                     withString:@">"  options:0 range:NSMakeRange(0, [_text length])];
-	[_text replaceOccurrencesOfString:@"<br>"                     withString:@"\n" options:0 range:NSMakeRange(0, [_text length])];
+	[self.text replaceOccurrencesOfString:@"<font color=\"#789922\">" withString:@""   options:0 range:NSMakeRange(0, [self.text length])];
+	[self.text replaceOccurrencesOfString:@"</font>"                  withString:@""   options:0 range:NSMakeRange(0, [self.text length])];
+	[self.text replaceOccurrencesOfString:@"&gt;"                     withString:@">"  options:0 range:NSMakeRange(0, [self.text length])];
+	[self.text replaceOccurrencesOfString:@"<br>"                     withString:@"\n" options:0 range:NSMakeRange(0, [self.text length])];
 	while ([_text replaceOccurrencesOfString:@"\n\n" withString:@"\n" options:0 range:NSMakeRange(0, [_text length])]) {
     };
-
-    _lines = [_text componentsSeparatedByString:@"\n"];
-
+
+    self.lines = [self.text componentsSeparatedByString:@"\n"];
+
     int x = 0;
     int y = MARGIN_H;
 	CGSize s;
 //	Board *board = [appDelegate getBoardByBoardId:boardId];
-
-    if ([_title isEqualToString:@""] &&
-        [_name  isEqualToString:@""] &&
-        [_mail  isEqualToString:@""]) {
-
-        _titleRect = CGRectZero;
-        _nameRect  = CGRectZero;
-        _mailRect  = CGRectZero;
+
+    if ([self.title isEqualToString:@""] &&
+        [self.name  isEqualToString:@""] &&
+        [self.mail  isEqualToString:@""]) {
+
+        self.titleRect = CGRectZero;
+        self.nameRect  = CGRectZero;
+        self.mailRect  = CGRectZero;
     } else {
-
+
     }
-
+
     x = BODY_X;
-
-    s = [_title sizeWithFont:FONT_TITLE forWidth:BOUND_W lineBreakMode:UILineBreakModeTailTruncation];
-    _titleRect = CGRectMake(x, y, s.width, s.height);
-
+
+    s = [self.title sizeWithFont:FONT_TITLE forWidth:BOUND_W lineBreakMode:UILineBreakModeTailTruncation];
+    self.titleRect = CGRectMake(x, y, s.width, s.height);
+
     x += s.width + MARGIN_W;
-
-    s = [_name sizeWithFont:FONT_TITLE forWidth:BOUND_W lineBreakMode:UILineBreakModeTailTruncation];
-    _nameRect = CGRectMake(x, y, s.width, s.height);
-
+
+    s = [self.name sizeWithFont:FONT_TITLE forWidth:BOUND_W lineBreakMode:UILineBreakModeTailTruncation];
+    self.nameRect = CGRectMake(x, y, s.width, s.height);
+
     x += s.width + MARGIN_W;
-
-    s = [_mail sizeWithFont:FONT_TITLE forWidth:BOUND_W lineBreakMode:UILineBreakModeTailTruncation];
-    _mailRect = CGRectMake(x, y, s.width, s.height);
-
+
+    s = [self.mail sizeWithFont:FONT_TITLE forWidth:BOUND_W lineBreakMode:UILineBreakModeTailTruncation];
+    self.mailRect = CGRectMake(x, y, s.width, s.height);
+
     x = BODY_X;
     y = s.height;
-
-    _textRect = CGRectMake(x, y, BOUND_W - x, BOUND_H - y);
+
+    self.textRect = CGRectMake(x, y, BOUND_W - x, BOUND_H - y);

 //	s = [NSString stringWithFormat:@"%d res", resCount];
diff --git a/skooma/CCThreadCell.m b/skooma/CCThreadCell.m
index ee7b00e..db2b13d 100644
--- a/skooma/CCThreadCell.m
+++ b/skooma/CCThreadCell.m
@@ -22,10 +22,7 @@

 - (void)setSelected:(BOOL)selected animated:(BOOL)animated
 {
-//    [super setSelected:selected animated:animated];
     [super setSelected:NO animated:NO];
-
-    // Configure the view for the selected state
 }

 - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
@@ -188,7 +185,7 @@
 //    [color.black set];
 //    [[NSString stringWithFormat:@"%d レス", _thread.resCount] drawInRect:CGRectMake(0, 0, 320, 60) withFont:font lineBreakMode:UILineBreakModeClip alignment:UITextAlignmentLeft];
     [color.black set];
-    [_thread.text drawInRect:CGRectMake(0, 0, 320, 60) withFont:font lineBreakMode:UILineBreakModeClip alignment:UITextAlignmentLeft];
+    [self.thread.text drawInRect:CGRectMake(0, 0, 320, 60) withFont:font lineBreakMode:UILineBreakModeClip alignment:UITextAlignmentLeft];

 //    [color.title set];
 //    [_thread.title drawInRect:_thread.titleRect withFont:boldFont];
diff --git a/skooma/CCThreadViewController.m b/skooma/CCThreadViewController.m
index 62805ad..a72f10d 100644
--- a/skooma/CCThreadViewController.m
+++ b/skooma/CCThreadViewController.m
@@ -19,7 +19,6 @@
 @property (nonatomic) NSMutableData *buffer;

 @property (nonatomic) CCSwipableCell *currentlyActiveSlidingCell;
-@property (nonatomic) CCSwipeDirection swipeDirection;

 @end

@@ -42,12 +41,12 @@
 {
     [super viewDidLoad];

-    _threads = [NSMutableArray new];
+    self.threads = [NSMutableArray new];

 //    CCURLRequest *request = [CCURLRequest requestWithURL:@"http://img.2chan.net/b/futaba.php?mode=cat&cxyl=100x100x256"];
     NSURLRequest *request = [NSURLRequest requestWithString:@"http://img.2chan.net/b/futaba.php?mode=cat&cxyl=5x5x256"];
-    _connection = [NSURLConnection connectionWithRequest:request delegate:self];
-    _buffer = [NSMutableData new];
+    self.connection = [NSURLConnection connectionWithRequest:request delegate:self];
+    self.buffer = [NSMutableData new];
 }

 - (void)viewDidUnload
@@ -74,9 +73,9 @@

 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
 {
-    NSLog(@"count ------------> %d", [_threads count]);
+    NSLog(@"count ------------> %d", [self.threads count]);
 //    return [_threads count];
-    return [_threads count];
+    return [self.threads count];
 }

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
@@ -85,7 +84,7 @@
     cell.selectionStyle = UITableViewCellSelectionStyleNone;
     cell.contentView.backgroundColor = [UIColor whiteColor];
     cell.textLabel.text = [NSString stringWithFormat:@"Cell %d", indexPath.row];
-    cell.swipeDirection = self.swipeDirection;
+    cell.swipeDirection = CCSwipeDirectionLeft;
     cell.delegate = self;

@@ -122,12 +121,12 @@

 - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
 {
-    _response = (NSHTTPURLResponse *)response;
+    self.response = (NSHTTPURLResponse *)response;
 }

 - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
 {
-    [_buffer appendData:data];
+    [self.buffer appendData:data];
 }

 - (void)connectionDidFinishLoading:(NSURLConnection *)connection
@@ -135,7 +134,7 @@
     [connection cancel];
     connection = nil;

-    if (_response.statusCode == 200) {
+    if (self.response.statusCode == 200) {
         [self scrape];
     }
 }
@@ -150,7 +149,7 @@
 {
     // カタログスクレイピング
     NSError *error;
-    NSString *string = [[NSString alloc] initWithData:_buffer encoding:NSShiftJISStringEncoding];
+    NSString *string = [[NSString alloc] initWithData:self.buffer encoding:NSShiftJISStringEncoding];
     NSString *pattern = @"<a.*?res/([0-9]*?).htm.*?><img src='(.*?)'.*?<small>(.*?)</small>.*?<font size=2>([0-9]*?)</font>";
     NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionDotMatchesLineSeparators error:&error];
     if (error) {
@@ -175,7 +174,8 @@
         [dictionary setObject:[string substringWithRange:[match rangeAtIndex:3]] forKey:@"text"];
         [dictionary setObject:[string substringWithRange:[match rangeAtIndex:4]] forKey:@"resCount"];
         CCThread *thread = [CCThread threadWithDictionary:dictionary];
-        [_threads addObject:thread];
+        [self.threads addObject:thread];
+
     }];

     [self.tableView reloadData];
@@ -188,14 +188,14 @@

 - (void)cellDidReceiveSwipe:(CCSwipableCell *)cell
 {
-    [_currentlyActiveSlidingCell slideInContentView];
-    _currentlyActiveSlidingCell = cell;
+    [self.currentlyActiveSlidingCell slideInContentView];
+    self.currentlyActiveSlidingCell = cell;
 }

 - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
 {
-    [_currentlyActiveSlidingCell slideInContentView];
-    _currentlyActiveSlidingCell = nil;
+    [self.currentlyActiveSlidingCell slideInContentView];
+    self.currentlyActiveSlidingCell = nil;
 }

 @end