Archive for the ‘iOS’ Category

 

core data | ios

6月 20th, 2012

Core Data Programming Guide http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CoreData/Articles/cdBasics.html#//apple_ref/doc/uid/TP40001650 こんな感じで、保存出来るらしい。sqliteも使えるっぽい。 xcodeでファイル追加 core data ⇒ data modelで .xcdatamodelというのが出来た。 ここに属性とかを入れていくらしい チュートリアルしてみる。 http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008305 emptyプロジェクトで use core data にチェックすると ヘッダーファイルに 01に書かれているように、Delegate.hに @property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext; @property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel; @property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator; – (NSURL *)applicationDocumentsDirectory; – (void)saveContext; が生成されている。 http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/iPhoneCoreData01/Articles/02_RootViewController.html 適当に入れて、一回目のビルド Undefined symbols for architecture i386: “_OBJC_CLASS_$_CLLocationManager”, referenced […]

Read full article | コメントは受け付けていません。

変数名を一括変換、修正 | xcode

6月 18th, 2012

変数名を間違えていたので修正するときには 変数名を選択 Edit > Refactor > Rename で変換すると変更部分も確認出来ました。

Read full article | コメントは受け付けていません。

segue セグエ | ios

6月 16th, 2012

segue セグエ 切れ目無く続くこと、滑らかに進行。 storyboardの連結部 seque セグウェイ、あの乗り物

Read full article | コメントは受け付けていません。

property設定時のパラメーターの英語の意味 | objective c

6月 15th, 2012

retain : 保つ copy : 写す、複製 assign : 割り当てる nonatomic : 原子でない。 [ atomic : 原子、(分割出来ない)] strong : 強い weak : 弱い メモ strongの参照を持つプロパティは、viewDidUnloadで = nil;する。

Read full article | コメントは受け付けていません。

ストーリーボード | iOS

6月 13th, 2012

2つ目のiOSアプリケーション:ストーリーボード https://developer.apple.com/jp/devcenter/ios/library/documentation/SecondiOSAppTutorial.pdf https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/SecondiOSAppTutorial/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011318 これをやってみる。

Read full article | コメントは受け付けていません。

UILabel の位置を変更

6月 12th, 2012

CGRect frame = priceLabel.frame; frame.origin.y = titleHeight+20; priceLabel.frame = frame; origin.x origin.yを変更すると変わる。

Read full article | コメントは受け付けていません。

UILabel sizeToFit | ios

6月 12th, 2012

lines : 0 linebreak : word wrap で titleLabel.text = @”あああああああああああああああああ”; CGRect frame = titleLabel.frame; frame.size.width=305; titleLabel.frame = frame; [titleLabel sizeToFit]; 幅を固定しておくことも重要なようです。 で文字数に合わせて高さが変わってくれました。

Read full article | コメントは受け付けていません。

macport tree

6月 7th, 2012

$ sudo port install tree

Read full article | コメントは受け付けていません。

objective-cでjsonを利用SBJson (aka json-framework)

6月 7th, 2012

http://stig.github.com/json-framework/api/3.0/index.html https://github.com/stig/json-framework/ 1. gitで取得 $ git clone https://github.com/stig/json-framework.git sbjson 2.classesの中のファイルをprojectに追加。 https://github.com/stig/json-framework/blob/master/INSTALL.md *.h *.m をすべてプロジェクトディレクトリにコピーして追加 3.利用するファイルにヘッダーを追加 #import “SBJson.h” コンパイルエラー SBJsonStreamParser.h:105: error: expected a property attribute before ‘unsafe_unretained’ こんな感じ http://stackoverflow.com/questions/7867983/cant-compiler-json-framework 意味が分からないのであまり良くないとは思うがデフォルト設定を変えてみるが、解決せず。 とりあえずxcodeのバージョンを最新にしてみるか 同様のエラーで、いくつか解決策のようなものもありましたが 結局。 SBJson関連ファイルがいくつか抜けていただけでした。 何も設定しなくても問題なく動きました。 os 1.7.4 xcode 4.3.2

Read full article | コメントは受け付けていません。

プロパティ、アクセサメソッド自動生成 | objective c

5月 26th, 2012

hello.h @property double nanswer; hello.m @synthesize nanswer; これで – (void) setNanswer: (double) nextAnswer { nanswer = nextAnswer; } – (double)nanswer { return nanswer; } を書かなくても自動生成してくれる。

Read full article | コメントは受け付けていません。