Replica
Wait reloadData of UITableView
resizableImageWithCapInsets

http://tech-gym.com/2013/01/ios/1096.html

resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right) では、伸縮したくない領域を指定する

Drow rounded frame

- (void)drawRect:(CGRect)rect {
    CGContextRef context = UIGraphicsGetCurrentContext();
   
    // Frame color/width
    CGContextSetRGBStrokeColor(context, 0.8, 0.8, 0.8, 1.0);
    CGContextSetLineWidth(context, 1.0);
   
    // Draw frame
    CGRect r1 = CGRectMake(10, 5.0, 300, 140);
    [self drawRoundRect:r1 withRadius:4.0 inContext:context];
   
    // Draw gray net
    CGContextSetRGBFillColor(context, 1, 1, 1, 1.0);
    CGRect r2 = CGRectMake(10, 5.0, 300, 140);
    [self fillRoundRect:r2 withRadius:4.0 inContext:context];
   
    // Set broken line
    const CGFloat dashStyle[] = {2.0};
    CGContextSetLineDash(context, 0.0, dashStyle, 1);
    CGContextSetLineCap(context,kCGLineCapRound);
   
    // Draw broken line
    CGContextMoveToPoint(context, rect.origin.x + 10, rect.origin.y + 110);
    CGContextAddLineToPoint(context, rect.size.width - 10, rect.origin.y + 110);
    CGContextStrokePath(context);
}

- (void)drawRoundRect:(CGRect)rect withRadius:(CGFloat)radius inContext:(CGContextRef)context {
    CGFloat lx = CGRectGetMinX(rect);
    CGFloat cx = CGRectGetMidX(rect);
    CGFloat rx = CGRectGetMaxX(rect);
    CGFloat by = CGRectGetMinY(rect);
    CGFloat cy = CGRectGetMidY(rect);
    CGFloat ty = CGRectGetMaxY(rect);
   
    CGContextMoveToPoint(context, lx, cy);
    CGContextAddArcToPoint(context, lx, by, cx, by, radius);
    CGContextAddArcToPoint(context, rx, by, rx, cy, radius);
    CGContextAddArcToPoint(context, rx, ty, cx, ty, radius);
    CGContextAddArcToPoint(context, lx, ty, lx, cy, radius);
    CGContextClosePath(context);
    CGContextStrokePath(context);
}

- (void)fillRoundRect:(CGRect)rect withRadius:(CGFloat)radius inContext:(CGContextRef)context {
    CGFloat lx = CGRectGetMinX(rect);
    CGFloat cx = CGRectGetMidX(rect);
    CGFloat rx = CGRectGetMaxX(rect);
    CGFloat by = CGRectGetMinY(rect);
    CGFloat cy = CGRectGetMidY(rect);
    CGFloat ty = CGRectGetMaxY(rect);
   
    CGContextMoveToPoint(context, lx, cy);
    CGContextAddArcToPoint(context, lx, by, cx, by, radius);
    CGContextAddArcToPoint(context, rx, by, rx, cy, radius);
    CGContextAddArcToPoint(context, rx, ty, cx, ty, radius);
    CGContextAddArcToPoint(context, lx, ty, lx, cy, radius);
    CGContextClosePath(context);

    CGContextFillPath(context);
}

Emacs font for Mac OS Marverics
Customize UITableViewCell

http://tanihiro.hatenablog.com/entry/2013/11/26/210456

[tableView registerNib:[UINib nibWithNibName:NSStringFromClass([TACell class]) bundle:nil] forCellReuseIdentifier:@"cell"];

(Line feed) 改行 for Emacs

http://d.hatena.ne.jp/n9d/20080215/1203043005

unix系の時

M-x replace-string (RET) 置換対象文字列 (RET) 置換文字列 C-q C-j (RET)

DOS(Windows)系の時

M-x replace-string (RET) 置換対象文字列 (RET) 置換文字列 C-q C-m C-q C-j (RET)

Set git repository after init
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/maeda-kazuya/InitTest.git
git push -u origin master
UIView animation でsubViewがはみ出るとき

         view.clipsToBounds = YES;

superViewのframeの大きさが変更されたときにsubViewがはみ出さないようにする


           

Viewの角を丸くする

Set in IB

http://stackoverflow.com/questions/12301256/is-it-possible-to-set-uiview-border-properties-from-interface-builder

or code as below

- (void)awakeFromNib {

    [[NSBundle mainBundle] loadNibNamed:@”foobar” owner:self options:nil];

    self.clipsToBounds = YES;
    self.layer.cornerRadius = 3.0f;

    [self addSubview:self.contentView];

}

UIPopoverController for iPhone