objective-c

inputAccessoryView が iPhone6 で キーボードにめり込む

Storyboard や、 xib ファイルから viewController を取得し、view を取り出したものを指定すると、表示が崩れる。コード上でUIView や UIButton を生成し、inputAccessoryView に渡す必要がある。

iOS8 AVPlayerItem を 変更時 アプリが落ちる

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x17001f8c0 of class AVPlayerItem was deallocated while key value observers were still registered with it. Current observation info: ( Conte…

画面回転時、navigationItem の 画像サイズを調整する

縦画面時は44px、横画面時は32px の画像を用意する必要があるが、 元からその2種類を登録するメソッドがあった。 - (void)setupNavigationBar { UIBarButtonItem *refreshBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItem…

天気API

日本だけであればいくつかAPIが存在したが、 海外にも対応する必要があったので、海外のAPIだが、使用されているAndroidアプリの評価が高く、有料の、 wundergroundを使用してみた。http://www.wunderground.com/weather/api/d/docs?d=data/index&MR=1 サポ…

16進数でUIColor をつくる

#import <UIKit/UIKit.h> @interface UIColor (UIColorEx) +(id)colorWithRGBA: (uint)rgba; +(id)colorWithRGB: (uint)rgb; @end #import "UIColor+RGBA.h" @implementation UIColor (RGBA) +(id)colorWithRGBA: (uint)rgba { const uint r = (rgba & 0xFF000000) >> 24; c</uikit/uikit.h>…

UIImagePickerController は iOS7 で バグっていて動きません

動きませんよ