2014-01-01から1年間の記事一覧
まずボタンを作成する。 //ボタンが押されるとpushAlertメソッドを呼び出す。 SEL method = @selector(pushAlert); UIButton * button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame = CGRectMake(20, 20, 40, 15); [button setTitle:…
Xcode,CommandLineToolsがインストールされているものとします。 ターミナルを立ち上げて ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)” を実行します。 passwordの入力を求められるのでpassを入力してenter 上手く行けば I…
スカラ変数は宣言時に初期化するのがよい習慣です。そうでないと、スタック領域にたまたま残って いた「ごみ」の値になってしまいます。 BOOL answer =NO; int magicnumber = 10; オブジェクトを指すポインタについては、これは必要ありません。初期値を指定…
クラスTestを新しく作成して@interface部に typedef struct{ int a,b,c; }character; と宣言をして更に @property character player; を宣言しました。 他のクラスからTest *test= [Test new];をして test.player.a = 10;とするとエラー これは内部的にtest.…
//.hファイルに typedef enum{ morning; afternoon; night; }env; @properrty env dayCondition; とすると self.dayCondition = morning; というようにアクセスすることができる。 このまま定数を使う予定のmファイルに#importしても定数を使えますが、 面倒…
#import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self paramSet2:100 str:10 vit:…
iphoneアプリ作りを始めたらまずやるのがとりあえずViewcontrollerもう一個作って画面遷移をしてみよう!ってやつ。 元からあるのをViewcontroller新しく作った画面をViewcontrollerSubとしよう。Viewcontrollerからcontrol押しながらViewcontrollerSubへ引…
Scene is unreachable due to lack of entry points and does not have an identifier for runtimeaccess via -instantiateViewControllerWithIdentifierScene is unreachable due to lack of entry points and does not have an identifier for runtimeacce…