iOSアプリ開発のメモ置き場

ささたつがiOSアプリ開発で知ったObjective-Cのtipsなどを書いていく所存

2013-11-01から1ヶ月間の記事一覧

ナビゲーション付きの初期化処理

#import "AppDelegate.h" #import "ViewController.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[U…

UITableView を使うなら実装(オーバーライド)しなきゃいけないメソッド

// 何行あるか - (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section { return [self.responseData count]; } // それぞれのセルの内容 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:…

ブレークポイントを消したいときのために知っておきたいたった一つのこと

掴んで左側のエリアにぽいっとするだけ。いちいち右クリックとかしなくておk!

StoryBoard は使わずに、ボタンをクリックしたときにラベルのテキストを変更する

#import "ViewController.h" @interface ViewController () @property (nonatomic, strong) UILabel *label; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; CGRect rect = CGRectMake(10, 10, 100, 100); self.label = […

Objective-C の @property と @synthesize ってなに?

setterとgetter(アクセッサメソッド)をコンパイルの前に生成させる。以上。 http://d.hatena.ne.jp/nakamura001/20101101/1288632739 https://gist.github.com/wneko/1358266

ボタンを追加する

- (void)viewDidLoad { [super viewDidLoad]; UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame = CGRectMake(50, 50, 100, 30); [button setTitle:@"click" forState:UIControlStateNormal]; [button addTarget:self a…

ラベルを追加する

- (void)viewDidLoad { [super viewDidLoad]; CGRect rect = CGRectMake(10, 10, 100, 100); UILabel *label = [[UILabel alloc] initWithFrame:rect]; label.text = @"start"; [self.view addSubview:label]; }

Storyboard で作った modal seque を閉じるには?

閉じたいボタンに対して、 - (IBAction)back:(UIButton *)sender { [[self presentingViewController] dismissViewControllerAnimated:YES completion:NULL]; }

SpringBoard failed to launch application with error: -3 みたいなエラーが出たときの解決方法

この辺でなおる。 Window > Organaizer > Projects > Derived Data > Delete シミュレータを一度終了する

Objective-C最初の一歩

#import "AppDelegate.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. return YES; }