iOS Swift Objective-C
まさにこれiPhone - iOS7で動的にステータスバーを消すとviewが移動してしまう - Qiita iPhone - iOS7で動的にステータスバーを消すとviewが移動してしまう - Qiita self.automaticallyAdjustsScrollViewInsets = NO;
//ナビバーの色を変更 self.navigationController.navigationBar.barTintColor= [UIColor blueColor]; //タイトルの文字の色を変更 self.navigationController.navigationBar.titleTextAttributes= @{NSForegroundColorAttributeName: [UIColor whiteColor]};
NSString* const strHoge = @"ほげほげ";
NSDictionaryにnilを入れようとすると怒られます。 なので下記のように回避できたので備忘録的に書き残しておきます。 static id ObjectOrNull(id object) { return object ?: [NSNull null]; }NSDictionary *article = @{TITLE : ObjectOrNull(p.title), LI…
xibでカスタムセルを作成後、ボタンを配置します。 そのボタンのviewtagのnumberを適当な数字に指定します。 (ここでは 7 を指定) 宣言 UIButton *btn_bookmark;@property (nonatomic, retain) UIButton *btn_bookmark;@synthesize btn_bookmark; 実際にcell…
uitableviewのcellをスワイプすると「delete」ボタンが出るアプリがあるけど、ページによって出したり出さなかったりを変えたいのでそのサンプル //まずはDeleteボタンを表示できるようにする - (void)tableView:(UITableView *)tableView commitEditingStyl…
ラストの文字列が何かで判断をする。 NSString *path = @"hogehoge.jpg"; if (![path hasSuffix:@".jpg"] && ![path hasSuffix:@".jpeg"] && !path hasSuffix:@".png"] && !path hasSuffix:@".gif"]) { //ここに処理を書く }