Xcode
iPadやiPhoneのSafariを使いたい時など、エミュレータをXcode無しで起動する方法。 プログラムは次のフォルダのなか /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/ApplicationsiOSシミュレータ.appを起動。iPh…
XMPPFrameworkをgitHubから入手 $ git clone https://github.com/robbiehanson/XMPPFramework.gitまずはデモの「ServerlessDemo」をXcodeで実行。iOS5.1対応もできているため、Xcode4.3ですんなりビルド完了。シミュレータで実行も、問題無し。iPhone実機に…
viewDidLoad()あたたりで、 AppDelegate appd = (〇〇AppDelegate *)[[UIApplication sharedApplication] delegate];
NSString *phoneName = [[UIDevice currentDevice] name]; NSString *phoneUniqueIdentifier = [[UIDevice currentDevice] uniqueIdentifier];
my_strに正規表現を使って、文字を切り出したサンプル。パターン定義の(...)を:[match rangeAtIndex:何個目]]で抜ける。 NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:@"^〒\\d{3}-\\d{4} (.+)" options:0 error:nil…
xcode 非同期処理のため、引き当てた住所をUIラベルで表示する...とかは、住所がセットされるタイミングに注意。 住所は、CLPlacemarkの中のmy_placemark.addressDictionaryの中のvalueForKey:@"FormattedAddressLines"を使用するが、郵便番号があったり、な…
改行の\nや、正規表現の\dとか、表示上では円(¥)記号だが、Xcodeでは「Alt+\」でバックスラッシュ(\)を必ず入れる
TabBarControllerのタブは、segueを繋げた順になってしまうが、TabBarControllerの各タブアイコンをドラッグすると、入れ替えることができる。
StroyBoardで、画面遷移元のViewControllerで「Ctrl+右クリック」し、遷移先に繋げる。modal/push等を選択しておき、プロパティウィンドウの「identify」でsegue名を設定する。 コードの中で、 [self performSegueWithIdentifier:@"segue名" sender:self];
行を選択し、「Ctrl+i」
UIAlertviewを複数個作って、それぞれ[self delegate]をやると、アクションがバッティングするため、tagを設定し、tagで処理を分ける。 //アラート画面のタグを宣言 static const NSInteger loginAlertTag = 1; static const NSInteger logoutAlertTag = 2; …