tag:blogger.com,1999:blog-52530954794725922152024-03-14T01:54:38.718+09:00始める!!iPhoneアプリiPhoneアプリの作成で自分が苦戦した事を主に。
情報共有とかいうスタンスで。
できるだけサンプルソースも載せるので、突っ込みをお願いいたします。Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.comBlogger44125tag:blogger.com,1999:blog-5253095479472592215.post-10531033819060856112014-09-03T11:42:00.004+09:002014-09-03T11:42:54.717+09:00ワーニング Capturing 'self' strongly in this block is likely to lead to a retain cycleCapturing 'self' strongly in this block is likely to lead to a retain cycle<br />
<br />
こんなエラーが出てしまった。<br />
<br />
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #4f8187;">oPageView</span><span style="color: black;"> </span>setViewControllers<span style="color: black;">:nextPage </span>direction<span style="color: black;">:</span>UIPageViewControllerNavigationDirectionForward<span style="color: black;"> </span>animated<span style="color: black;">:</span><span style="color: #bb2ca2;">NO</span><span style="color: black;"> </span>completion<span style="color: black;">:^(</span><span style="color: #bb2ca2;">BOOL</span><span style="color: black;"> finished) {</span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #4f8187;">oTableView</span><span style="color: black;"> </span>scrollToRowAtIndexPath<span style="color: black;">:iPagePath </span>atScrollPosition<span style="color: black;">:</span>UITableViewScrollPositionTop<span style="color: black;"> </span>animated<span style="color: black;">:</span><span style="color: #bb2ca2;">YES</span><span style="color: black;">];</span></div>
<br />
<div style="font-family: Menlo; font-size: 11px;">
}];</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Blockの中にインスタント変数を参照するとワーニングになります。</div>
<div>
<br /></div>
<div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">__block</span> <span style="color: #703daa;">UITableView</span> *tablViewself = <span style="color: #4f8187;">oTableView</span>;</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #4f8187;">oPageView</span><span style="color: black;"> </span>setViewControllers<span style="color: black;">:nextPage </span>direction<span style="color: black;">:</span>UIPageViewControllerNavigationDirectionForward<span style="color: black;"> </span>animated<span style="color: black;">:</span><span style="color: #bb2ca2;">NO</span><span style="color: black;"> </span>completion<span style="color: black;">:^(</span><span style="color: #bb2ca2;">BOOL</span><span style="color: black;"> finished) {</span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [tablViewself </span>scrollToRowAtIndexPath<span style="color: black;">:iPagePath </span>atScrollPosition<span style="color: black;">:</span>UITableViewScrollPositionTop<span style="color: black;"> </span>animated<span style="color: black;">:</span><span style="color: #bb2ca2;">YES</span><span style="color: black;">];</span></div>
<div style="font-family: Menlo; font-size: 11px;">
}];</div>
</div>
<div>
<br /></div>
<br />
こんな感じで、変数を外だしにするとOKです。Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-79726631422560211212014-09-03T10:50:00.002+09:002014-09-03T10:50:39.696+09:00Warning ワーニング 'UITextAlignmentCenter' is deprecated: first deprecated in iOS 6.0'UITextAlignmentCenter' is deprecated: first deprecated in iOS 6.0<br />
<br />
<br />
こんなワーニングがでました。<br />
<br />
<br />
<br />
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;">× [</span><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span><span style="color: #4f8187;">title</span><span style="color: black;"> </span>setTextAlignment<span style="color: black;">:</span>UITextAlignmentCenter<span style="color: black;">];</span></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<br />
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span><span style="color: #4f8187;">title</span><span style="color: black;"> </span>setTextAlignment<span style="color: black;">:</span>NSTextAlignmentCenter<span style="color: black;">];</span></div>
<div>
<span style="color: black;"><br /></span></div>
<div>
<span style="color: black;">上のように変更したら、oKになりました。</span></div>
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-82888275505809697092014-09-03T10:45:00.001+09:002014-09-03T10:45:29.468+09:00Warning ワーニング Property access result unused - getters should not be used for side effects Property access result unused - getters should not be used for side effects<br />
<br />
こんなワーニングだ出ていました。<br />
<br />
<br />
調べたところ、<br />
<br />
オブジェクト.関数名<br />
<br />
となっているところを<br />
<br />
[オブジェクト 関数名]<br />
にすると<br />
OKでした。<br />
<br />
<br />
<span style="color: #4f8187; font-family: Menlo; font-size: 11px;"><br /></span>
<span style="color: #4f8187; font-family: Menlo; font-size: 11px;">oWebView</span><span style="font-family: Menlo; font-size: 11px;">.</span><span style="color: #3d1d81; font-family: Menlo; font-size: 11px;">goBack</span><span style="font-family: Menlo; font-size: 11px;">;</span><br />
<div>
<span style="color: black;">↓</span></div>
<div>
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: black;">[</span>oWebView<span style="color: black;"> </span><span style="color: #3d1d81;">goBack</span><span style="color: black;">];</span></div>
</div>
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-78398350192375162002014-08-27T01:19:00.003+09:002014-08-27T01:19:37.769+09:00Deprecations 'setFont:' is deprecated: first deprecated in iOS 3.0こんなワーニングが出てしまった。。。<br />
<br />
'setFont:' is deprecated: first deprecated in iOS 3.0<br />
<br />
こんな使い方が駄目らしい。。。<br />
↓<br />
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;">[oBackBtn </span>setFont<span style="color: black;">:[</span><span style="color: #703daa;">UIFont</span><span style="color: black;"> </span>fontWithName<span style="color: black;">:</span><span style="color: #78492a;">sFONTNAME</span><span style="color: black;"> </span>size<span style="color: black;">:</span><span style="color: #272ad8;">15</span><span style="color: black;">]];</span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
修正後<br />
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;">[oBackBtn.</span><span style="color: #703daa;">titleLabel</span><span style="color: black;"> </span>setFont<span style="color: black;">:[</span><span style="color: #703daa;">UIFont</span><span style="color: black;"> </span>fontWithName<span style="color: black;">:</span><span style="color: #78492a;">sFONTNAME</span><span style="color: black;"> </span>size<span style="color: black;">:</span><span style="color: #272ad8;">15</span><span style="color: black;">]];</span></div>
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-22619017417776166382014-01-31T01:07:00.001+09:002014-01-31T01:07:07.250+09:00エラー Failed to instantiate the default view controller for UIMainStoryboardFile 'Storyboard' - perhaps the designated entry point is not set?<div style="font-family: Menlo; font-size: 11px;">
<b>Failed to instantiate the default view controller for UIMainStoryboardFile 'Storyboard' - perhaps the designated entry point is not set?</b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b><br /></b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b><br /></b></div>
<b><span style="font-family: Menlo;"><span style="font-size: 11px;">initial Sceneの設定がちゃんとできていないと表示されます。</span></span></b><br />
<b><span style="font-family: Menlo;"><span style="font-size: 11px;"><br /></span></span></b>
<b><span style="font-family: Menlo;"><span style="font-size: 11px;">または</span></span></b><br />
<b><span style="font-family: Menlo;"><span style="font-size: 11px;"><br /></span></span></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-OZ8tSgnw78g/Uup4mW7yZEI/AAAAAAAAAKg/tkiiVpThZ_0/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2014-01-31+1.04.33.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-OZ8tSgnw78g/Uup4mW7yZEI/AAAAAAAAAKg/tkiiVpThZ_0/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2014-01-31+1.04.33.png" height="160" width="640" /></a></div>
<b><span style="font-family: Menlo;"><span style="font-size: 11px;"><br /></span></span></b>Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-4895064733638105132014-01-05T21:17:00.000+09:002014-01-05T21:17:06.790+09:00ASO( AppStoreランキング向上, ランキング向上, 検索上位)アプリのインストール数を増やすために必要なのがASO!!<br />
<br />
AppStoreで言うと、キーワードやタイトルを改良することで改善され、<br />
検索上位に表示されます。<br />
<br />
どこかの数字によると、<br />
Storeで検索してから、アプリをインストールするユーザーは60%いるそうです。<br />
<br />
何か、いいもの作ったけど、あんまりアプリをインストールされていない!!って人は是非試してみて下さい。<br />
<br />
ついでに自分はインストール数が10倍増えました。いや、本当に!!<br />
お金をかけずに簡単にインストール数を増やせます。<br />
<br />
では何をするかというと、<br />
<br />
①タイトルを長くします。<br />
<br />
パズル&ドラゴン<br />
とか<br />
LINE<br />
<br />
みたいな有名なアプリはユーザーがタイトルからアプリを一本釣りでインストールするアプリです。<br />
ですが、あなたが作るアプリは一本釣りされるアプリではありません。<br />
<br />
なので、タイトルを255バイトいっぱいにつけましょう<br />
<br />
パズル&ドラゴン -無料,RPG, アクション<br />
LINE -無料,Mail,メール,通話<br />
<br />
これが255バイトあるかわかりませんが、こんな感じでいろいろな単語を入れておくの重要です。<br />
タイトルにある単語が検索の時に引っかかる単語なので、是非いろいろと試して下さい。<br />
また、AppStoreの検索ロジックの特徴として、メールとMailで検索結果が大きく違う事です。<br />
google Playだと、そこら辺の空気を読んでくれますが。。。。<br />
<br />
②キーワードの登録です。<br />
これは①に入っていない単語を載せる事がミソです。<br />
タイトルとキーワード2つあると強くなる!!みたいなことはありません。<br />
潔く、タイトルと違う文字を入力してください。<br />
<br />
なので、ヴァイオリン,バイオリン<br />
見たいに書くのをオススメします。<br />
<br />
③いいレビューを貰う<br />
これはすぐにできる事ではないのですが、<br />
簡単にできることとして、アプリからレビュー画面に遷移するボタンを作っておくといいよ。<br />
<br />
以上です。<br />
<br />
<br />
アプリの説明文は、何かないの??<br />
<br />
とか思われる方もいるかもしれません。<br />
GooglePlayだと、キーワードを5つ重複させる事が重要とか、<br />
あるんですが、AppStoreはないです。<br />
アプリの説明文は検索表示と関係ないです(多分。。)<br />
<br />
<br />
終わりに<br />
自分の感想ですが、GooglePlayよりもAppStoreの方が<br />
ASOでわりとインストール数を稼げます。Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-56013444629042146182013-12-23T19:35:00.001+09:002013-12-23T19:35:03.225+09:00012-ロード中にぐるぐる回すインディケーター( UIActivityIndicatorView, UIActivityIndicatorViewStyleWhiteLarge)ロード中や読み込み時に表示するグルグル回すインディケ−タの使い方を記述します。<br />
<br />
■生成<br />
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
UIActivityIndicatorView<span style="color: black;">* indicator = [[</span>UIActivityIndicatorView<span style="color: black;"> </span><span style="color: #3d1d81;">alloc</span><span style="color: black;">] </span><span style="color: #3d1d81;">init</span><span style="color: black;">];</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black; font-family: Times; font-size: small;">■オブジェクトの場所を指定</span></div>
<div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;">[</span><span style="color: #4f8187;">indicator型</span><span style="color: black;"> </span>setFrame<span style="color: black;">:</span>CGRectMake<span style="color: black;">(</span><span style="color: #272ad8;">0</span><span style="color: black;">, </span><span style="color: #272ad8;">0</span><span style="color: black;">, </span><span style="color: #272ad8;">100</span><span style="color: black;">, </span><span style="color: #272ad8;">100</span><span style="color: black;">)];</span></div>
</div>
<div>
<span style="color: black;"><br /></span></div>
■くるくる回す<br />
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;">[</span><span style="color: #4f8187;">indicator型</span><span style="color: black;"> </span>startAnimating<span style="color: black;">];</span></div>
<div>
<span style="color: black;"><br /></span></div>
■くるくる回さない<br />
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: black;">[</span>indicator型<span style="color: black;"> </span><span style="color: #3d1d81;">stopAnimating</span><span style="color: black;">];</span></div>
<div>
<span style="color: black;"><br /></span></div>
<div>
■回っているかの判定</div>
<div>
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: black;">[</span>indicator型<span style="color: black;"> </span><span style="color: #3d1d81;">isAnimating</span><span style="color: black;">] </span></div>
返し値はBOOL値<br />
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: black; font-family: Times; font-size: small;">■ぐるぐるが回っていない時にぐるぐるを非表示時にするかの設定</span></div>
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: black;">[</span>indicator型<span style="color: black;"> </span><span style="color: #3d1d81;">setHidesWhenStopped</span><span style="color: black;">:(BOOL)]</span></div>
YES,NOで設定。true falseでは駄目だった<br />
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: black; font-family: Times; font-size: small;">■ぐるぐる停止時の表示を取得</span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;">[</span><span style="color: #4f8187;">indicator型</span><span style="color: black;"> </span>hidesWhenStopped<span style="color: black;">]</span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black; font-family: Times; font-size: small;">返し値はBOOL値</span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black; font-family: Times; font-size: small;"><br /></span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black; font-family: Times; font-size: small;">■ぐるぐるの大きさの指定</span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: #4f8187;">indicator型</span><span style="color: black;">.</span><span style="color: #703daa;">activityIndicatorViewStyle</span><span style="color: black;"> = </span>UIActivityIndicatorViewStyleWhiteLarge<span style="color: black;">;</span></div>
<div>
<br /></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
定数</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
UIActivityIndicatorViewStyleWhiteLarge</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
白色、大きめ</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
UIActivityIndicatorViewStyleWhite</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
白色</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
UIActivityIndicatorViewStyleGray</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
灰色</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black; font-family: Times; font-size: small;">■サンプルソース</span></div>
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<span style="color: #78492a;">#import </span>"ViewController.h"</div>
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">@interface</span><span style="color: black;"> </span>ViewController<span style="color: black;"> (){</span></div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">// </span>アクティビティインジケータ変数</div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>UIActivityIndicatorView<span style="color: black;">* indicatorLarg;</span></div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #bb2ca2; font-family: Menlo; font-size: 11px;">
@end</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">@implementation</span> ViewController</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #bb2ca2;">void</span>)viewDidLoad</div>
<div style="font-family: Menlo; font-size: 11px;">
{</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #bb2ca2;">super</span><span style="color: black;"> </span>viewDidLoad<span style="color: black;">];</span></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>画面背景を黒色にする</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span><span style="color: #703daa;">view</span><span style="color: black;"> </span>setBackgroundColor<span style="color: black;">:[</span><span style="color: #703daa;">UIColor</span><span style="color: black;"> </span>blackColor<span style="color: black;">]];</span></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>ぐるぐる回るポジション</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">CGRect</span> rect = <span style="color: #3d1d81;">CGRectMake</span>(<span style="color: #272ad8;">0</span>, <span style="color: #272ad8;">0</span>, <span style="color: #272ad8;">100</span>, <span style="color: #272ad8;">100</span>);</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #008400;">//</span><span style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN';">ぐるぐる回るインディケータの生成</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #4f8187;">indicatorLarg</span><span style="color: black;"> = [[</span>UIActivityIndicatorView<span style="color: black;"> </span><span style="color: #3d1d81;">alloc</span><span style="color: black;">]</span><span style="color: #3d1d81;">initWithFrame</span><span style="color: black;">:rect];</span></div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">// </span>アクティビティインジケータのスタイルをセット<span style="font-family: Menlo;"> :</span>今回は大きめのサイズ</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #4f8187;">indicatorLarg</span><span style="color: black;">.</span><span style="color: #703daa;">activityIndicatorViewStyle</span><span style="color: black;"> = </span>UIActivityIndicatorViewStyleWhiteLarge<span style="color: black;">;</span></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">// </span>くるくるをまわす</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #4f8187;">indicatorLarg</span><span style="color: black;"> </span>startAnimating<span style="color: black;">];</span></div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>// UIActivityIndicatorView<span style="font-family: 'Hiragino Kaku Gothic ProN';">のインスタンスをビューに追加</span></div>
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span><span style="color: #703daa;">view</span><span style="color: black;"> </span><span style="color: #3d1d81;">addSubview</span><span style="color: black;">:</span>indicatorLarg<span style="color: black;">];</span></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>タッチジェスチャーを取得</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">UITapGestureRecognizer</span>* tapRecognizer = [[<span style="color: #703daa;">UITapGestureRecognizer</span> <span style="color: #3d1d81;">alloc</span>] <span style="color: #3d1d81;">initWithTarget</span>:<span style="color: #bb2ca2;">self</span> <span style="color: #3d1d81;">action</span>:<span style="color: #bb2ca2;">@selector</span>(handleTapGesture:)];</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>タッチジェスチャーをビューに設定</div>
<div style="font-family: Menlo; font-size: 11px;">
[<span style="color: #bb2ca2;">self</span>.<span style="color: #703daa;">view</span> <span style="color: #3d1d81;">addGestureRecognizer</span>:tapRecognizer];</div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="font-family: Menlo;">//</span>タッチされた時の判定</div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #bb2ca2;">void</span>)handleTapGesture:(<span style="color: #703daa;">UITapGestureRecognizer</span> *)sender {</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>ぐるぐる回っているかの判定</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">if</span> ( [<span style="color: #4f8187;">indicatorLarg</span> <span style="color: #3d1d81;">isAnimating</span>] ){</div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>//<span style="font-family: 'Hiragino Kaku Gothic ProN';">ぐるぐる</span>STOP!!</div>
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span>indicatorLarg<span style="color: black;"> </span><span style="color: #3d1d81;">stopAnimating</span><span style="color: black;">];</span></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>ぐるぐる<span style="font-family: Menlo;">STOP</span>時に隠すか止まったままにするか</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">bool</span> bIsHide = [<span style="color: #4f8187;">indicatorLarg</span> <span style="color: #3d1d81;">hidesWhenStopped</span>];</div>
<div style="font-family: Menlo; font-size: 11px;">
[<span style="color: #4f8187;">indicatorLarg</span> <span style="color: #3d1d81;">setHidesWhenStopped</span>:!bIsHide];</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="font-family: Menlo; font-size: 11px;">
}<span style="color: #bb2ca2;">else</span>{</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>ぐるぐる回っていなかったら、回す</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #4f8187;">indicatorLarg</span><span style="color: black;"> </span>startAnimating<span style="color: black;">];</span></div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #bb2ca2;">void</span>)didReceiveMemoryWarning</div>
<div style="font-family: Menlo; font-size: 11px;">
{</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #bb2ca2;">super</span><span style="color: black;"> </span>didReceiveMemoryWarning<span style="color: black;">];</span></div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>// Dispose of any resources that can be recreated.</div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
</div>
<div style="color: #bb2ca2; font-family: Menlo; font-size: 11px;">
@end</div>
<div style="color: #bb2ca2; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #bb2ca2; font-family: Menlo; font-size: 11px;">
<br /></div>
■実行結果<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-gbRdSGnSUBs/UrgQcpB9h0I/AAAAAAAAAKI/juOiB0nv7u8/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-12-23+19.28.39.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-gbRdSGnSUBs/UrgQcpB9h0I/AAAAAAAAAKI/juOiB0nv7u8/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-12-23+19.28.39.png" width="209" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-i6mCGs8_jNc/UrgQkcK_AuI/AAAAAAAAAKU/VRAMtDQTqrA/s1600/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2013-12-23+19.29.18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://4.bp.blogspot.com/-i6mCGs8_jNc/UrgQkcK_AuI/AAAAAAAAAKU/VRAMtDQTqrA/s320/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2013-12-23+19.29.18.png" width="213" /></a></div>
<br />
こんな感じになります。<br />
<br />
タッチすると、ぐるぐるが止まって、<br />
もう一回タッチすると動きだします。<br />
<br />
<br />
このロード中のぐるぐるの正式名称は何て言うんですかね??</div>
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-53084587607447074292013-10-27T12:27:00.002+09:002013-10-27T12:27:26.434+09:00古いXcodeをインストール自分は勇者タイプなので、 OSやソフトに新しいバージョンがあると果敢に挑みます。<br />
<br />
だがしかし、<br />
適応能力がいまひとつのために新しいバージョンに付いていけない事があります。<br />
今回はXcode5にしたものの、iOS7化対応に付いていけなくて<br />
。。。。。<br />
そんな時のために<br />
Xcodeのバージョンを複数もつ方法を紹介します。<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-yV-3jE5jih8/Umxvu-zvFAI/AAAAAAAAAJ4/GYSeT2nwVho/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-10-27+10.37.05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://1.bp.blogspot.com/-yV-3jE5jih8/Umxvu-zvFAI/AAAAAAAAAJ4/GYSeT2nwVho/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-10-27+10.37.05.png" width="206" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-JlX7V5zuObM/UmxvpA6cY5I/AAAAAAAAAJ0/2QCNv8qlCo0/s1600/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2013-10-27+10.42.15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="89" src="http://4.bp.blogspot.com/-JlX7V5zuObM/UmxvpA6cY5I/AAAAAAAAAJ0/2QCNv8qlCo0/s320/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2013-10-27+10.42.15.png" width="320" /></a></div>
<br />
<br />
【Finder】→【Xcode】→【右クリック】→【パッケージの表示】→【_MASReceipt】のフォルダ名を変更<br />
<br />
これで、他のバージョンのXcodeが上書きされなくります。<br />
<br />
<br />
https://developer.apple.com/downloads/index.action#<br />
<br />
ここで、xcodeで検索すれば、上書きしないでインストールできます。Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-16642938507120506232013-10-13T18:42:00.001+09:002013-10-13T18:42:24.204+09:00Xcode5 電波情報などのステータスバーを消す(View controller-based status bar appearance)<br />
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [ </span>UIApplication<span style="color: black;"> </span><span style="color: #3d1d81;">sharedApplication</span><span style="color: black;"> ].</span>statusBarHidden<span style="color: black;"> = </span><span style="color: #bb2ca2;">YES</span><span style="color: black;">;</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;">今まではこのソースで消せたのですが。。</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;">Xcode5のせいかiOS7のせいか消せなくなりました。。。。</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;">格闘する事、10,000時間。。。。</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-HsDziEsnWQY/Ulpn6v5eO_I/AAAAAAAAAJU/5DecGG8lr5Y/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-10-13+18.24.50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="260" src="http://1.bp.blogspot.com/-HsDziEsnWQY/Ulpn6v5eO_I/AAAAAAAAAJU/5DecGG8lr5Y/s640/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-10-13+18.24.50.png" width="640" /></a></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;">Keyのところに+をクリックして、</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
View controller-based status bar appearance</div>
<div style="font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
Type を Boolean</div>
<div style="font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
Value を NO</div>
<div style="font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
にすると、</div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [ </span>UIApplication<span style="color: black;"> </span><span style="color: #3d1d81;">sharedApplication</span><span style="color: black;"> ].</span>statusBarHidden<span style="color: black;"> = </span><span style="color: #bb2ca2;">YES</span><span style="color: black;">;</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;">のソースが利くようです。</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;">あー、面倒だ</span></div>
<!-- adticker Zone: [WebHeader] -->
<div class="adticker_frame sid_6585ee868e089110f94702f1463fa70f281a0b9a68e783ca container_div color_#0000CC-#444444-#FFFFFF-#0000FF-#009900 sp"></div>Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-56130494500841142892013-09-20T01:07:00.003+09:002013-09-20T01:07:51.811+09:00Appleから The bundle does not contain an app icon for iPhone <span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;">The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format</span><br />
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;">アプリをアップロードしたら、こんなエラーが出ました。。</span><br />
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;">アプリのアイコン120×120が必要らしいです。</span><br />
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-ZIWZTb_IwkA/UjsfSL7hElI/AAAAAAAAAI0/6WKj0DGIEXw/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-09-20+0.57.28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="308" src="http://2.bp.blogspot.com/-ZIWZTb_IwkA/UjsfSL7hElI/AAAAAAAAAI0/6WKj0DGIEXw/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-09-20+0.57.28.png" width="400" /></a></div>
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;">けど、この画面には</span><span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;">120×120をはめる場所がなくて。。。</span><br />
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;">あたふたする事、10時間</span><br />
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<span style="font-family: 'MS PGothic', sans-serif; line-height: 19px;">Summaryタブから、Infoタブに遷移して</span><br />
<span style="font-family: 'MS PGothic', sans-serif; line-height: 19px;">icon_filesに新しいitemを作り120×120の画像を</span><br />
<span style="font-family: MS PGothic, sans-serif;"><span style="line-height: 19px;">入れるとOKです。</span></span><br />
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Yxghih6ibak/UjsgN7NxyfI/AAAAAAAAAJE/lcMUiBEveyM/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-09-20+0.55.46.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="92" src="http://2.bp.blogspot.com/-Yxghih6ibak/UjsgN7NxyfI/AAAAAAAAAJE/lcMUiBEveyM/s640/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-09-20+0.55.46.png" width="640" /></a></div>
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<span style="background-color: white; font-family: 'MS PGothic', sans-serif; font-size: 16px; line-height: 19px;"><br /></span>
<br />
iOS7から、アイコンが120×120になるのですかね??Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-53964792890647188682013-08-25T20:12:00.003+09:002013-08-25T20:12:59.789+09:00iconをテカらせない、ツヤ消しiconがテカるのがいやなので、<br />
テカらせない方法を探していたのですが、<br />
<br />
検索ワードのセンスがなかったのか、<br />
なかなかお目当てのページが見つかりませんでした。。。<br />
<br />
■方法<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-H3Eg3E7-LFQ/UhnlubQUq3I/AAAAAAAAAIk/2cQ6E-3q1uo/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-25+20.07.40.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="100" src="http://1.bp.blogspot.com/-H3Eg3E7-LFQ/UhnlubQUq3I/AAAAAAAAAIk/2cQ6E-3q1uo/s640/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-25+20.07.40.png" width="640" /></a></div>
<br />
Icon already includes gloss effects<br />
この値をBoolean型のYESにすると完了です。<br />
「アイコンはもうテカテカです。」<br />
という意味らしいです。<br />
<br />
[Icon files]→[Primary Icon]の中に作ってね!!!!<br />
<br />
<br />Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-91307223435754803032013-07-31T02:31:00.000+09:002013-07-31T02:31:28.735+09:00JSON(NSJSONSerialization)Objective-CでJSONを使いたかったので、少し勉強してみました。<br />
<br />
<br />
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">NSDictionary</span><span style="color: black;"> *jsonParser = [</span><span style="color: #703daa;">NSJSONSerialization</span><span style="color: black;"> </span>JSONObjectWithData<span style="color: black;">:WebApiから取得した文字列のデータ型 </span>options<span style="color: black;">:</span>NSJSONReadingAllowFragments<span style="color: black;"> </span>error<span style="color: black;">:</span><span style="color: #bb2ca2;">nil</span><span style="color: black;">];</span></div>
<div>
<span style="color: black;"><br /></span></div>
<br />
こんな感じで、Dictionaryに格納したら、後はDictionaryをガンガン使っていけばいいだけです。<br />
<br />
■例<br />
<br />
{"resulr":"true","item_list":{"item_1":"apple","item_2":"banana","item_3":"melon"}}<br />
<br />
こんな、文字列をWebから貰ったとします。。<br />
<br />
<br />
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>文字列型をデータ型に型変更</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #703daa;">NSData</span><span style="color: black;"> *data = [string </span>dataUsingEncoding<span style="color: black;">:</span>NSUTF8StringEncoding<span style="color: black;">];</span></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>ディクショナリに入れる</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #703daa;">NSDictionary</span><span style="color: black;"> *jsonParser = [</span><span style="color: #703daa;">NSJSONSerialization</span><span style="color: black;"> </span>JSONObjectWithData<span style="color: black;">:data </span>options<span style="color: black;">:</span>NSJSONReadingAllowFragments<span style="color: black;"> </span>error<span style="color: black;">:</span><span style="color: #bb2ca2;">nil</span><span style="color: black;">];</span></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>//result<span style="font-family: 'Hiragino Kaku Gothic ProN';">を取得</span></div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">NSDictionary</span> *next = [jsonParser <span style="color: #3d1d81;">objectForKey</span>:<span style="color: #d12f1b;">@"result"</span>];</div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>//LOG</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #3d1d81;">NSLog</span>(<span style="color: #d12f1b;">@"%@"</span>, [jsonParser <span style="color: #3d1d81;">objectForKey</span>:<span style="color: #d12f1b;">@"result"</span>]);</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>深めの階層も大丈夫!!</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">NSDictionary</span> *country = [jsonParser <span style="color: #3d1d81;">objectForKey</span>:<span style="color: #d12f1b;">@"item_list"</span>];</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #3d1d81;">NSLog</span>(<span style="color: #d12f1b;">@"%@"</span>, [jsonParser <span style="color: #3d1d81;">objectForKey</span>:<span style="color: #d12f1b;">@"item_list"</span>]);</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>取得したい値を取得</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">NSDictionary</span> *item = [country <span style="color: #3d1d81;">objectForKey</span>:<span style="color: #d12f1b;">@"item_1"</span>];</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #3d1d81;">NSLog</span>(<span style="color: #d12f1b;">@"%@"</span>, [country <span style="color: #3d1d81;">objectForKey</span>:<span style="color: #d12f1b;">@"item_1"</span>]);</div>
<br />
<br />
<br />
■結果<br />
<br />
<br />
<div style="font-family: Menlo; font-size: 11px;">
<b>2013-07-31 01:59:01.046 jsontest[678:c07] {"result":"true","item_list":{"item_1":"apple","item_2":"banana","item_3":"melon"}}</b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b>2013-07-31 01:59:01.048 </b><b>jsontest</b><b>[678:c07] true</b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b>2013-07-31 01:59:01.048 </b><b>jsontest</b><b>[678:c07] {</b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b> "item_1" = apple;</b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b> "item_2" = banana;</b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b> "item_3" = melon;</b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b>}</b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b>2013-07-31 01:59:01.048 hidouki[678:c07] apple</b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b><br /></b></div>
<div style="font-family: Menlo; font-size: 11px;">
<b><br /></b></div>
<div style="font-family: Menlo; font-size: 11px;">
</div>
<div style="font-family: Times; font-size: medium;">
こんな感じになりました。</div>
<div style="font-family: Times; font-size: medium;">
そもそもDictionary型をちゃんと理解していないので、</div>
<div style="font-family: Times; font-size: medium;">
こんな使い方でいいのかわかりませんが。。。。</div>
<div style="font-family: Times; font-size: medium;">
とりあえずは、APIの戻り値をさばけました。。</div>
<br />
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-28966042713513842652013-06-30T15:26:00.001+09:002013-06-30T15:26:19.343+09:00アプリの表示固定( orientations)アプリを端末の向きに依存させたくない時、ありませんか??<br />
<br />
横固定だったり、縦固定だったりと<br />
<br />
そんな時は<br />
<br />
対象のプロジェクトをクリック→TARGET→Summary<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-SS-NOcEIj9A/Uc_JaZ6zW9I/AAAAAAAAAIU/U8LmBAgLrBs/s790/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-06-30+14.55.44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="108" src="http://2.bp.blogspot.com/-SS-NOcEIj9A/Uc_JaZ6zW9I/AAAAAAAAAIU/U8LmBAgLrBs/s640/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-06-30+14.55.44.png" width="640" /></a></div>
<br />
Supported Interface Orientations<br />
で選びます。<br />
可能な画面表示を選びます。<br />
<br />
黒っぽいのが選択中ってことです。<br />
<br />
Portrait :縦画面OK<br />
UpsideDown :上下反転OK<br />
LandScapeLeft :横表示のボタン左側OK<br />
LandScapeRight :横表示のボタン右側OK<br />
<br />
開発中に特別に画面の横対応をしていないのなら、<br />
縦画面の左2つを選択しておくといいかなとおもいます。<br />
<br />
<br />
反対に画面の横対応しかしていないなら、<br />
右2つを選択していればだいたいOKです。<br />
<br />
<br />
<br />
<br />Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-85790489919171576392013-06-29T02:26:00.002+09:002013-06-29T02:26:17.152+09:00なうい 配列の書き方今日職場のおじいちゃんに<br />
「お前のコーティングの書き方は古い!!」<br />
<br />
と言われちゃいました。。。<br />
<br />
聞くところによると、<br />
iOS 10.5<br />
以前と以降で推奨される、<br />
書き方がいろいろと変わっていました。<br />
<br />
<br />
とりあえず、今日調べたところを書きます。<br />
<br />
■配列の作成<br />
<br />
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
</div>
// NSArray* oCountryArray = [NSArray arrayWithObjects:@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">スペイン</span>",@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">イングランド</span>",@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">イタリア</span>",@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">ドイツ</span>",@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">オランダ</span>",nil];<br />
<div style="color: #d12f1b;">
<span style="color: black;"> </span><span style="color: #703daa;">NSArray</span><span style="color: black;">* oCountryArray = </span><span style="color: #272ad8;">@[</span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">スペイン</span>"<span style="color: black;">,</span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">イングランド</span>"<span style="color: black;">,</span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">イタリア</span>"<span style="color: black;">,</span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">ドイツ</span>"<span style="color: black;">,</span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">オランダ</span>"<span style="color: #272ad8;">]</span><span style="color: black;">;</span></div>
<div>
<span style="color: black;"><br /></span></div>
<br />
<br />
上が古くて下が新しいです。<br />
<br />
基本的にはスッキリン子しました。<br />
また、nilがなくなったのが個人的にはうれしいかな。<br />
<br />
■配列の取り出し<br />
<br />
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
// NSString* aLabel = [oCountryArray objectAtIndex:_cellCount];</div>
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #703daa;">NSString</span><span style="color: black;">* aLabel = </span>oCountryArray<span style="color: black;">[</span>_cellCount<span style="color: black;">];</span></div>
<div>
<span style="color: black;"><br /></span></div>
<br />
これもシンプルになっています。<br />
他のjavaとかと同じ感じですね。<br />
<br />
他にも見つけたら、載せます。Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-44171910473696725162013-06-16T03:14:00.004+09:002013-06-16T03:14:45.636+09:00エラー error: failed to attach to process ID 0 <br />
<div style="font-family: Menlo; font-size: 11px;">
error: failed to attach to process ID 0</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
何のエラーか、よくわからなかったけど。。</div>
<div>
<br /></div>
<div>
どうやら、シミュレータのエラーのようです。</div>
<div>
<br /></div>
<div>
シミュレータ内のデータが消えてもいいのなら、</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-Pu1rDvxqdng/Ubyu42iJeOI/AAAAAAAAAIA/JJHhO70HSDo/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-06-16+3.13.15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="274" src="http://4.bp.blogspot.com/-Pu1rDvxqdng/Ubyu42iJeOI/AAAAAAAAAIA/JJHhO70HSDo/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-06-16+3.13.15.png" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
コンテンツと設定をリセットを選択。。</div>
<div>
<br /></div>
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-23184091302019302162013-05-17T15:40:00.001+09:002013-05-17T15:40:14.516+09:00エラー error: PCH file built from a different branch <br />
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
error: PCH file built from a different branch </div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
XCODEのバージョンアップ後に発生!!</div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
プロジェクトをクリーンしたら、問題解決</div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
<br /></div>
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-75349932760080860052013-05-06T14:43:00.003+09:002013-05-06T14:43:25.593+09:00011-Foundation(フレームワーク, import)<br />
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
Foundationは文字列や配列の処理、HTTP通信などの基本クラスを集めたフレームワークです。</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
クラスも多々ありますが、有名どころを下記にしるします。</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
リンク先はリファレンスになっております。</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<br /></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
■代表的なクラス</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/doc/uid/TP40003620" style="font-family: 'Lucida Grande'; font-size: 11px;">NSArray</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSCalendar_Class/Reference/NSCalendar.html#//apple_ref/doc/uid/TP40003626" style="font-family: 'Lucida Grande'; font-size: 11px;">NSCalendar</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003640" style="font-family: 'Lucida Grande'; font-size: 11px;">NSData</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003641" style="font-family: 'Lucida Grande'; font-size: 11px;">NSDate</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003648" style="font-family: 'Lucida Grande'; font-size: 11px;">NSDictionary</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003688" style="font-family: 'Lucida Grande'; font-size: 11px;">NSMutableArray</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003706" style="font-family: 'Lucida Grande'; font-size: 11px;">NSObject</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/doc/uid/TP40003744" style="font-family: 'Lucida Grande'; font-size: 11px;">NSString</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/Reference/NSTimer.html#//apple_ref/doc/uid/TP40003747" style="font-family: 'Lucida Grande'; font-size: 11px;">NSTimer</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003752" style="font-family: 'Lucida Grande'; font-size: 11px;">NSURL</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003755" style="font-family: 'Lucida Grande'; font-size: 11px;">NSURLConnection</a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<br /></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
</div>
NSArray 配列を扱うクラス<br />
NSDate 日時を扱うクラス<br />
<br />
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
NSString 文字列を扱うクラス</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
NSTimer 時間処理を行うためのクラス</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<br /></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<br /></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
■Foundationフレームワークの使い方</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
作成したプロジェクトの「Frameworks」に「Foundation」があるかの確認して見ましょう</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-LEuU4c2AJ14/UYc-TD8aLXI/AAAAAAAAAHw/EqonL7m_81g/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-06+14.22.39.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="145" src="http://3.bp.blogspot.com/-LEuU4c2AJ14/UYc-TD8aLXI/AAAAAAAAAHw/EqonL7m_81g/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-06+14.22.39.png" width="400" /></a></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<br /></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
■.pchファイル</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
</div>
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<span style="color: #78492a;">#import </span><Availability.h></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #78492a; font-family: Menlo; font-size: 11px;">
#ifndef __IPHONE_5_0</div>
<div style="color: #78492a; font-family: Menlo; font-size: 11px;">
#warning "This project uses features only available in iOS SDK 5.0 and later."</div>
<div style="color: #78492a; font-family: Menlo; font-size: 11px;">
#endif</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #78492a; font-family: Menlo; font-size: 11px;">
#ifdef __OBJC__</div>
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<span style="color: #78492a;"> #import </span><UIKit/UIKit.h></div>
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<span style="color: #78492a;"> #import </span><Foundation/Foundation.h></div>
<div style="color: #78492a; font-family: Menlo; font-size: 11px;">
#endif</div>
<div>
<br /></div>
<br />
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<br /></div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<span style="color: #78492a; font-family: Menlo; font-size: 11px;">#import </span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;"><Foundation/Foundation.h></span> が存在していれば、</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
どのクラスでもわざわざ各クラスでimportしなくても「Foundation」のフレームワークが利用できます。</div>
<div style="font-family: 'Hiragino Kaku Gothic ProN'; font-size: 12px;">
<br /></div>
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-33581003106895560662013-05-05T17:40:00.001+09:002013-05-05T17:40:03.802+09:00objectie-c エスケープ文字エスケープ文字で改行や、タブの文字列もコントロールできるようにしましょう<br />
<br />
シングルクォーテーション<br />
<span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"\'"</span><br />
<br />
ダブルクォーテーション<br />
<span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"\""</span>
<br />
<span style="color: #d12f1b; font-family: Menlo; font-size: 11px;"><br /></span>
改行<br />
<span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
@"\n"</span>
<br />
<span style="color: #d12f1b; font-family: Menlo; font-size: 11px;"><br /></span>
タブ<br />
<span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
@"\t"</span>
<br />
<span style="color: #d12f1b; font-family: Menlo; font-size: 11px;"><br /></span>
バックスラッシュ<br />
<span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"\</span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">\</span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">"</span><br />
<br />
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<br /></div>
【例】<br />
<div style="color: #d12f1b; font-size: 11px;">
</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN';">
<span style="font-family: Menlo;">//</span>改行でスプリット</div>
<div style="color: #3d1d81; font-family: Menlo;">
<span style="color: #703daa;">NSArray</span><span style="color: black;">* sText = [</span><span style="color: #4f8187;">sHTML</span><span style="color: black;"> </span>componentsSeparatedByString<span style="color: black;">:</span><span style="color: #d12f1b;">@"\n"</span><span style="color: black;">];</span></div>
<div style="font-family: Menlo;">
<span style="color: black;"><br /></span></div>
<div>
<span style="color: #008400;"><span style="font-family: Menlo;">//</span><span style="font-family: Hiragino Kaku Gothic ProN;">こんな文字列で始まっていたら</span></span></div>
<span style="color: #bb2ca2;">if</span><span style="color: black;"> ( [str </span><span style="color: #3d1d81;">hasPrefix</span><span style="color: black;">:</span>@"<a class=\"ts_left\" href=\""<span style="color: black;">] ){</span><br />
<br />
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<br /></div>
<br />
<br />
<br />
<br />Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-85659548379808498722013-04-24T23:46:00.001+09:002013-08-25T19:08:25.540+09:00012-NSString(Foundation)NSStringクラス<br />
<br />
生成<br />
<span style="color: #703daa; font-family: Menlo; font-size: 11px;">NSString</span><span style="font-family: Menlo; font-size: 11px;">* 変数名 = </span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"文字列"</span><span style="font-family: Menlo; font-size: 11px;">;</span><br />
<br />
<div>
<span style="color: #703daa; font-family: Menlo; font-size: 11px;">NSString</span><span style="font-family: Menlo; font-size: 11px;">* </span><span style="font-family: Menlo; font-size: 11px;">変数名</span><span style="font-family: Menlo; font-size: 11px;"> = [[</span><span style="color: #703daa; font-family: Menlo; font-size: 11px;">NSString</span><span style="font-family: Menlo; font-size: 11px;"> </span><span style="color: #3d1d81; font-family: Menlo; font-size: 11px;">alloc</span><span style="font-family: Menlo; font-size: 11px;">] </span><span style="color: #3d1d81; font-family: Menlo; font-size: 11px;">initWithString</span><span style="font-family: Menlo; font-size: 11px;">:</span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"</span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">文字列</span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">"</span><span style="font-family: Menlo; font-size: 11px;">];</span></div>
<br />
<div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">NSString</span>* 変数名 = [<span style="color: #703daa;">NSString</span> <span style="color: #3d1d81;">stringWithFormat</span>:<span style="color: #d12f1b;">@"</span><span style="color: #d12f1b;">文字列</span><span style="color: #d12f1b;">"</span>];</div>
</div>
<div>
<br /></div>
<div>
こんな感じで生成できます。</div>
<div>
<br /></div>
<br />
■指定した文字かの判定<br />
<br />
<span style="color: #703daa; font-family: Menlo; font-size: 11px;">NSString* </span><span style="color: #4f8187; font-family: Menlo; font-size: 11px;">sText</span><span style="color: #703daa; font-family: Menlo; font-size: 11px;"> = </span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"比較先"</span><span style="font-family: Menlo; font-size: 11px;">;</span><br />
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">[</span><span style="color: #4f8187;">sText</span><span style="color: #703daa;"> </span><span style="color: #3d1d81;">isEqualToString</span><span style="color: black;">:</span><span style="color: #d12f1b;">@"比較もと"</span><span style="color: black;">]</span><span style="color: #3d1d81;">;</span></div>
<div style="font-family: Menlo; font-size: 11px;">
<br /></div>
結果はBooleanで返されます。<br />
今回の出力結果は偽になります。<br />
<br />
■指定した文字列ではじまっているかの判定<br />
<br />
<span style="color: #703daa; font-family: Menlo; font-size: 11px;">NSString* </span><span style="color: #4f8187; font-family: Menlo; font-size: 11px;">sText</span><span style="color: #703daa; font-family: Menlo; font-size: 11px;"> = </span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"比較先"</span><span style="font-family: Menlo; font-size: 11px;">;</span><br />
<span style="color: #703daa; font-family: Menlo; font-size: 11px;">[</span><span style="color: #4f8187; font-family: Menlo; font-size: 11px;">sText</span><span style="color: #703daa; font-family: Menlo; font-size: 11px;"> </span><span style="color: #3d1d81; font-family: Menlo; font-size: 11px;">hasPrefix</span><span style="font-family: Menlo; font-size: 11px;">:</span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"比較"</span><span style="font-family: Menlo; font-size: 11px;">]</span><span style="color: #3d1d81; font-family: Menlo; font-size: 11px;">;</span><br />
<br />
結果はBooleanで返されます。<br />
今回の出力結果は真になります。<br />
<div>
<br /></div>
<div>
■指定した文字列で終わっているかの判定<br />
<br />
<span style="color: #703daa; font-family: Menlo; font-size: 11px;">NSString* </span><span style="color: #4f8187; font-family: Menlo; font-size: 11px;">sText</span><span style="color: #703daa; font-family: Menlo; font-size: 11px;"> = </span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"比較先"</span><span style="font-family: Menlo; font-size: 11px;">;</span><br />
<span style="color: #703daa; font-family: Menlo; font-size: 11px;">[</span><span style="color: #4f8187; font-family: Menlo; font-size: 11px;">sText</span><span style="color: #703daa; font-family: Menlo; font-size: 11px;"> </span><span style="color: #3d1d81; font-family: Menlo; font-size: 11px;">hasSuffix</span><span style="font-family: Menlo; font-size: 11px;">:</span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"較先"</span><span style="font-family: Menlo; font-size: 11px;">]</span><span style="color: #3d1d81; font-family: Menlo; font-size: 11px;">;</span><br />
<br />
<br />
結果はBooleanで返されます。<br />
今回の出力結果は真になります。</div>
<div>
<br /></div>
<div>
■文字列の後ろから返す<br />
<br />
<span style="color: #703daa; font-family: Menlo; font-size: 11px;">NSString* </span><span style="color: #4f8187; font-family: Menlo; font-size: 11px;">sText</span><span style="color: #703daa; font-family: Menlo; font-size: 11px;"> = </span><span style="color: #d12f1b; font-family: Menlo; font-size: 11px;">@"比較先"</span><span style="font-family: Menlo; font-size: 11px;">;</span><br />
<span style="color: #703daa; font-family: Menlo; font-size: 11px;">[</span><span style="color: #4f8187; font-family: Menlo; font-size: 11px;">sText</span><span style="color: #703daa; font-family: Menlo; font-size: 11px;"> </span><span style="color: #3d1d81; font-family: Menlo; font-size: 11px;">substringFromIndex</span><span style="font-family: Menlo; font-size: 11px;">:<span style="color: #d12f1b;">int型</span></span><span style="font-family: Menlo; font-size: 11px;">]</span><span style="color: #3d1d81; font-family: Menlo; font-size: 11px;">;</span></div>
<div>
<br /></div>
指定した文字列から最後までの文字列を返します。<br />
<br />
<br />
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;">[</span><span style="color: #4f8187;">sText</span><span style="color: black;"> </span>substringFromIndex<span style="color: black;">:</span><span style="color: #4f8187;"> sText</span><span style="color: black;">.</span>length<span style="color: black;"> - </span><span style="color: #272ad8;">1</span><span style="color: black;">]</span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
こんな感じにすると、sTextの最後の文字列を返します。<br />
-1を-2にすると、後ろから2文字目を全て返します。。。<br />
<br />
<br />
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-55451885717681537812013-04-07T16:32:00.000+09:002013-04-07T16:32:04.315+09:00010-ピッカーの表示(UIPickerView)ピッカーの使い方に関して。。<br />
<br />
iPhone使ってる人はピッカーで何の事かわかるのすかね??<br />
<br />
ドラムロールから、任意のステータスを選択するあれです。<br />
<br />
では、例文です。<br />
<br />
■サンプルソース<br />
<br />
h.ファイル<br />
<br />
<br />
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<span style="color: #78492a;">#import </span><UIKit/UIKit.h></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">@interface</span><span style="color: black;"> ViewController : </span>UIViewController<span style="color: black;"> <</span>UIPickerViewDelegate<span style="color: black;">,</span>UIPickerViewDataSource<span style="color: black;">>{</span></div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">NSArray</span>* aItemList;</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">UIPickerView</span>* oPicker;</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">UILabel</span>* oLabel;</div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #bb2ca2; font-family: Menlo; font-size: 11px;">
@end</div>
<div>
<br /></div>
<div>
<br />
m.ファイル</div>
<div>
<br /></div>
<div>
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<span style="color: #78492a;">#import </span>"ViewController.h"</div>
<div style="color: #4f8187; font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">@interface</span><span style="color: black;"> </span>ViewController<span style="color: black;"> ()</span></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #bb2ca2; font-family: Menlo; font-size: 11px;">
@end</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">@implementation</span> ViewController</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #bb2ca2;">void</span>)viewDidLoad</div>
<div style="font-family: Menlo; font-size: 11px;">
{</div>
<div style="color: #31595d; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #bb2ca2;">self</span><span style="color: black;"> </span>showPicker<span style="color: black;">];</span></div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #bb2ca2;">super</span><span style="color: black;"> </span>viewDidLoad<span style="color: black;">];</span></div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span>// Do any additional setup after loading the view, typically from a nib.</div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #bb2ca2;">void</span>)didReceiveMemoryWarning</div>
<div style="font-family: Menlo; font-size: 11px;">
{</div>
<div style="color: #3d1d81; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> [</span><span style="color: #bb2ca2;">super</span><span style="color: black;"> </span>didReceiveMemoryWarning<span style="color: black;">];</span></div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>// Dispose of any resources that can be recreated.</div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #bb2ca2;">void</span>)showPicker {</div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="color: black; font-family: Menlo;"> </span><span style="font-family: Menlo;">//</span>ピッカーにアイテムを格納</div>
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #4f8187;">aItemList</span><span style="color: black;"> = [[</span><span style="color: #703daa;">NSMutableArray</span><span style="color: black;"> </span><span style="color: #3d1d81;">alloc</span><span style="color: black;">] </span><span style="color: #3d1d81;">initWithObjects</span><span style="color: black;">:</span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">リンゴ</span>"<span style="color: black;">,</span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">バナナ</span>"<span style="color: black;">,</span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">マンゴー</span>"<span style="color: black;">,</span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">パパイア</span>"<span style="color: black;">, </span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">ドリアン</span>"<span style="color: black;">,</span><span style="color: #bb2ca2;">nil</span><span style="color: black;">];</span></div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>// <span style="font-family: 'Hiragino Kaku Gothic ProN';">ピッカーの生成</span></div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #4f8187;">oPicker</span> = [[<span style="color: #703daa;">UIPickerView</span> <span style="color: #3d1d81;">alloc</span>] <span style="color: #3d1d81;">init</span>];</div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>//<span style="font-family: 'Hiragino Kaku Gothic ProN';">中央に表示</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #4f8187;">oPicker</span><span style="color: black;">.</span>center<span style="color: black;"> = </span><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span>view<span style="color: black;">.</span>center<span style="color: black;">;</span></div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #4f8187;">oPicker</span><span style="color: black;">.</span>showsSelectionIndicator<span style="color: black;"> = </span><span style="color: #bb2ca2;">YES</span><span style="color: black;">;</span></div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #4f8187;">oPicker</span>.<span style="color: #703daa;">delegate</span> = <span style="color: #bb2ca2;">self</span>;</div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #4f8187;">oPicker</span><span style="color: black;">.</span>dataSource<span style="color: black;"> = </span><span style="color: #bb2ca2;">self</span><span style="color: black;">;</span></div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>//<span style="font-family: 'Hiragino Kaku Gothic ProN';">画面に追加</span></div>
<div style="font-family: Menlo; font-size: 11px;">
[<span style="color: #bb2ca2;">self</span>.<span style="color: #703daa;">view</span> <span style="color: #3d1d81;">addSubview</span>:<span style="color: #4f8187;">oPicker</span>];</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
</div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>//<span style="font-family: 'Hiragino Kaku Gothic ProN';">ラベルの生成</span></div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #4f8187;">oLabel</span> = [[<span style="color: #703daa;">UILabel</span> <span style="color: #3d1d81;">alloc</span>] <span style="color: #3d1d81;">init</span>];</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #4f8187;">oLabel</span>.<span style="color: #703daa;">frame</span> = <span style="color: #3d1d81;">CGRectMake</span>(<span style="color: #272ad8;">0</span>,<span style="color: #272ad8;">0</span>,<span style="color: #272ad8;">200</span>,<span style="color: #272ad8;">50</span>);</div>
<div style="color: #d12f1b; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span><span style="color: #4f8187;">oLabel</span><span style="color: black;">.</span><span style="color: #703daa;">text</span><span style="color: black;"> =</span>@"<span style="font-family: 'Hiragino Kaku Gothic ProN';">何が選ばれるのだろう</span>"<span style="color: black;">;</span></div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>//<span style="font-family: 'Hiragino Kaku Gothic ProN';">画面に追加</span></div>
<div style="font-family: Menlo; font-size: 11px;">
[<span style="color: #bb2ca2;">self</span>.<span style="color: #703daa;">view</span> <span style="color: #3d1d81;">addSubview</span>:<span style="color: #4f8187;">oLabel</span>];</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="font-family: Menlo;">//</span>区切りの数(コンポーネント)</div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #703daa;">NSInteger</span>)numberOfComponentsInPickerView:(<span style="color: #703daa;">UIPickerView</span> *)pickerView{</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">return</span> <span style="color: #272ad8;">1</span>;</div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="font-family: Menlo;">//</span>コンポーネントの行数を返す</div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #703daa;">NSInteger</span>)pickerView:(<span style="color: #703daa;">UIPickerView</span> *)pickerView numberOfRowsInComponent:(<span style="color: #703daa;">NSInteger</span>)component{</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">return</span> [<span style="color: #4f8187;">aItemList</span> <span style="color: #3d1d81;">count</span>];</div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #703daa;">NSString</span> *)pickerView:(<span style="color: #703daa;">UIPickerView</span> *)pickerView titleForRow:(<span style="color: #703daa;">NSInteger</span>)row forComponent:(<span style="color: #703daa;">NSInteger</span>)component{</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">return</span> [<span style="color: #4f8187;">aItemList</span> <span style="color: #3d1d81;">objectAtIndex</span>:row];</div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="font-family: Menlo;">//</span>選択完了時に呼ばれる</div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #bb2ca2;">void</span>)pickerView:(<span style="color: #703daa;">UIPickerView</span> *)pickerView didSelectRow:(<span style="color: #703daa;">NSInteger</span>)row inComponent:(<span style="color: #703daa;">NSInteger</span>)component{</div>
<div style="color: #008400; font-family: Menlo; font-size: 11px;">
<span style="color: black;"> </span>//<span style="font-family: 'Hiragino Kaku Gothic ProN';">選択行を返す</span></div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #703daa;">NSInteger</span> <span style="color: #bb2ca2;">id</span> = [pickerView <span style="color: #3d1d81;">selectedRowInComponent</span>:<span style="color: #272ad8;">0</span>];</div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #4f8187;">oLabel</span>.<span style="color: #703daa;">text</span> = [<span style="color: #703daa;">NSString</span> <span style="color: #3d1d81;">stringWithFormat</span>:<span style="color: #d12f1b;">@"%@"</span>,<span style="color: #4f8187;">aItemList</span>[<span style="color: #bb2ca2;">id</span>]];</div>
<div style="font-family: Menlo; font-size: 11px;">
}</div>
<div style="font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="color: #bb2ca2; font-family: Menlo; font-size: 11px;">
@end</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
■実行結果</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-m0WWB17NqjY/UWEfeEK1Z3I/AAAAAAAAAHU/vLnT8L2JGyI/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-04-07+16.25.13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://4.bp.blogspot.com/-m0WWB17NqjY/UWEfeEK1Z3I/AAAAAAAAAHU/vLnT8L2JGyI/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-04-07+16.25.13.png" width="183" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-z-uyQNHv5dM/UWEfsNbonHI/AAAAAAAAAHc/2JWaTZgmVyM/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-04-07+16.26.17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://1.bp.blogspot.com/-z-uyQNHv5dM/UWEfsNbonHI/AAAAAAAAAHc/2JWaTZgmVyM/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-04-07+16.26.17.png" width="183" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
実行すると、</div>
<div>
選択した項目が文字列で出力できていることが確認できると思います。</div>
<div>
<br /></div>
<div>
hファイルでデリゲートの準備をし忘れないように!</div>
<div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: #bb2ca2;">@interface</span><span style="color: black;"> ViewController : </span>UIViewController<span style="color: black;"> <</span>UIPickerViewDelegate<span style="color: black;">,</span>UIPickerViewDataSource<span style="color: black;">>{</span></div>
</div>
<div>
<span style="color: black;"><br /></span></div>
<div>
mファイルの生成時にデリゲートが呼ばれます。</div>
<div>
<div style="font-family: Menlo; font-size: 11px;">
<span style="color: #4f8187;">oPicker</span>.<span style="color: #703daa;">delegate</span> = <span style="color: #bb2ca2;">self</span>;</div>
<div style="color: #703daa; font-family: Menlo; font-size: 11px;">
<span style="color: #4f8187;">oPicker</span><span style="color: black;">.</span>dataSource<span style="color: black;"> = </span><span style="color: #bb2ca2;">self</span><span style="color: black;">;</span></div>
</div>
<div>
<span style="color: black;"><br /></span></div>
<div>
<span style="color: black;"><br /></span></div>
<div>
<div style="color: #008400; font-family: 'Hiragino Kaku Gothic ProN'; font-size: 11px;">
<span style="font-family: Menlo;">//</span>選択完了時に呼ばれる</div>
<div style="font-family: Menlo; font-size: 11px;">
- (<span style="color: #bb2ca2;">void</span>)pickerView:(<span style="color: #703daa;">UIPickerView</span> *)pickerView didSelectRow:(<span style="color: #703daa;">NSInteger</span>)row inComponent:(<span style="color: #703daa;">NSInteger</span>)component</div>
</div>
<div>
この関数を作成すると、選択している項目を取得できます。</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
正直UIPickerViewはコードで全部書くのはしんどかったです。</div>
<div>
はい。</div>
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-65683838123497264152013-04-06T18:55:00.004+09:002013-04-07T16:33:20.961+09:00アイコン画像・起動画面(App Icons, Launch Images)iPhoneアプリに必要な画像のサイズを適当にメモっておきます。<br />
リリース前にはそろえましょう!!<br />
<br />
■アイコン(App Icons)<br />
・サイズ(単位はpx)<br />
57×57<br />
114×114 Retina<br />
・保存形式<br />
png<br />
<br />
■起動画面(Launch Images)<br />
<br />
・サイズ(単位はpx)<br />
320×480 <br />
640×960 Retina3.5<br />
640×1136 Retina3.5<br />
・保存形式<br />
png<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<br />
<br />Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-16500237793315253792013-03-10T13:30:00.004+09:002013-03-10T13:30:37.413+09:00ビルドエラー<br />
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
Code Sign error: A valid provisioning profile matching the application's Identifier '' could not be found</div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
<br /></div>
<div>
このエラーが出たときは、</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-yfk1i73G5a0/UTIP2jQisRI/AAAAAAAAAGE/H2zSKUg9Qeg/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-03-02+23.42.00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="301" src="http://2.bp.blogspot.com/-yfk1i73G5a0/UTIP2jQisRI/AAAAAAAAAGE/H2zSKUg9Qeg/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-03-02+23.42.00.png" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
この画面の「Bundle identifer」に修正が必要です。</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
「Organizer」画面の「App identifer」の最初のカンマまでのよくわからない英数字を</div>
<div>
除いた文字列が「Bundle identifer」です。</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
Code Sign error: No unexpired provisioning profiles found that contain any of the keychain's signing certificates</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-tdERlT1E6Dw/UTIUfJummuI/AAAAAAAAAGc/WYrozUN0erI/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-03-03+0.01.43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="98" src="http://1.bp.blogspot.com/-tdERlT1E6Dw/UTIUfJummuI/AAAAAAAAAGc/WYrozUN0erI/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-03-03+0.01.43.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
このエラーがでたら、</div>
<div>
「Code Signing」の「Release」をiOS Distributionにすると、</div>
<div>
通りました。<br />
<br />
<br /></div>
<div>
<br />
<br />
Icon specified in the info plist not found under the top level app wrapper:<br />
<br />
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-9tq1d6mbNJY/UTwLldh1cKI/AAAAAAAAAGs/r9Uo5ChGIF0/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-03-03+2.26.18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="22" src="http://4.bp.blogspot.com/-9tq1d6mbNJY/UTwLldh1cKI/AAAAAAAAAGs/r9Uo5ChGIF0/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-03-03+2.26.18.png" width="400" /></a></div>
<br /></div>
<div>
こんなエラーのときは<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-XaYxUj8SFhE/UTwMEUi4p5I/AAAAAAAAAG0/Z4tt74C1peI/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-03-03+14.36.03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="110" src="http://4.bp.blogspot.com/-XaYxUj8SFhE/UTwMEUi4p5I/AAAAAAAAAG0/Z4tt74C1peI/s640/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-03-03+14.36.03.png" width="640" /></a></div>
<br />
itemに空の値が入っていないか確認してください。<br />
<br />
空が入っていた場合には、削除しちゃえばOK!!</div>
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-2820257025376012022013-03-01T02:19:00.004+09:002013-03-01T02:19:58.160+09:00目次Objective-C<br />
<div style="text-align: left; text-indent: -15px;">
<span style="color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 15px;"><br /></span></span></div>
<ul class="posts" style="border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none none; margin: 0px; padding: 0px; text-align: left; text-indent: -15px;">
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2012/12/001-xcode-objective-c.html" style="background-color: white; color: #4d469c; text-decoration: none;">001-変数について(Xcode, Objective-C)</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2012/12/002-xcode-objective-c.html" style="background-color: white; color: #4d469c; text-decoration: none;">002-ポインター変数について(Xcode, Objective-C)</a></li>
<li style="background-image: none; border-bottom-style: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-bottom-style: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2012/12/003-xcode-objective-c.html" style="background-color: white; color: #4d469c; text-decoration: none;">003-関数(Xcode, Objective-C)</a></li>
<li style="background-image: none; border-bottom-style: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
</ul>
<div style="text-align: left; text-indent: -15px;">
<ul class="posts" style="border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none none; margin: 0px; padding: 0px;">
<li style="background-image: none; border-top-style: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/01/004-interface-implementation.html" style="background-color: white; color: #4d469c; text-decoration: none;">004-クラス(@interface @implementation)</a></li>
</ul>
</div>
<ul class="posts" style="border-width: 0px; list-style: none none; margin: 0px; padding: 0px; text-align: left; text-indent: -15px;">
<li style="background-image: none; border-top-style: none; border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-top-style: none; border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/02/objective-cinit.html" style="background-color: white; color: #4d469c; text-decoration: none;">Objective-Cでコンストラクター?(init)</a></li>
<li style="background-image: none; border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2012/12/defineconst.html" style="background-color: white; color: #4d469c; text-decoration: none;">#defineとconstどちらを使えばいいのかな??</a></li>
<li style="color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px;"></li>
</ul>
<br />
<br />
機能<br />
<div>
<br /></div>
<div>
<ul class="posts" style="border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none none; margin: 0px; padding: 0px; text-align: left; text-indent: -15px;">
<li style="background-image: none; border-top-style: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/01/005-nsuserdefaults.html" style="background-color: white; color: #4d469c; text-decoration: none;">005-保存機能(NSUserDefaults)</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/01/storyboarduilabel.html" style="background-color: white; color: #4d469c; text-decoration: none;">006−storyboardを使わないでラベル表示(UILabel)</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/01/007-buttonuibutton.html" style="background-color: white; color: #4d469c; text-decoration: none;">007-Button(UIButton)</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/01/008uialertview.html" style="background-color: white; color: #4d469c; text-decoration: none;">008−ダイアログの作成(UIAlertView)</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/01/009-bgmavaudioplayer.html" style="background-color: white; color: #4d469c; text-decoration: none;">009-BGMの再生(AVAudioPlayer)</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
</ul>
</div>
<div>
<ul class="posts" style="border-width: 0px; list-style: none none; margin: 0px; padding: 0px; text-align: left; text-indent: -15px;">
<li style="background-image: none; border-top-style: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em; text-align: -webkit-auto; text-indent: 0px;"> その他<div style="color: black; font-family: Times; font-size: medium; line-height: normal; text-align: -webkit-auto; text-indent: 0px;">
</div>
</li>
<li style="background-image: none; border-top-style: none; border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/01/admobgadbannerview.html" style="background-color: white; color: #4d469c; text-decoration: none;">Admob組み込み(GADBannerView)</a></li>
</ul>
<div style="text-align: left; text-indent: -15px;">
<span style="color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 15px;"><br /></span></span></div>
</div>
<div style="text-align: left; text-indent: -15px;">
<div style="text-align: -webkit-auto; text-indent: 0px;">
エラー</div>
<div style="text-align: -webkit-auto; text-indent: 0px;">
<ul class="posts" style="border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none none; margin: 0px; padding: 0px; text-align: left; text-indent: -15px;">
<li style="background-image: none; border-top-style: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/01/undefined-symbols-for-architecture-i386.html" style="background-color: white; color: #4d469c; text-decoration: none;">Undefined symbols for architecture i386 エラー</a></li>
<li></li>
</ul>
</div>
<div style="text-align: -webkit-auto; text-indent: 0px;">
<br /></div>
<div style="text-align: -webkit-auto; text-indent: 0px;">
<div style="text-align: left; text-indent: -15px;">
<br />
<ul class="posts" style="border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none none; margin: 0px; padding: 0px;">
<li style="background-image: none; border-bottom-style: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/02/no-provisioned-ios-devices-are.html" style="background-color: white; color: #4d469c; text-decoration: none;">シミュレータがいきなり使えなくなった(No provisioned iOS devices are ...</a></li>
<li></li>
</ul>
</div>
<div style="text-align: left; text-indent: -15px;">
</div>
</div>
<div style="text-align: -webkit-auto; text-indent: 0px;">
<br /></div>
<div style="text-align: -webkit-auto; text-indent: 0px;">
<ul class="posts" style="border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none none; margin: 0px; padding: 0px; text-align: left; text-indent: -15px;">
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/02/missing-context-for-method-declaration.html" style="background-color: white; color: #4d469c; text-decoration: none;">Missing context for method declaration</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/02/used-as-name-of-previous-parameter.html" style="background-color: white; color: #4d469c; text-decoration: none;">used as the name of the previous parameter rather ...</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/02/no-visible-interface-for-declares.html" style="background-color: white; color: #4d469c; text-decoration: none;">no visible @interface for declares the selector</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/02/unknown-type-name-did-you-mean.html" style="background-color: white; color: #4d469c; text-decoration: none;">Unknown type name "", did you mean</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/02/apple-mach-o-linker-error.html" style="background-color: white; color: #4d469c; text-decoration: none;">Apple Mach-O Linker Error</a></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><br /></li>
<li style="background-image: none; border-width: 0px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2013/02/ould-not-load-nib-in-bundle-nsbundle.html" style="background-color: white; color: #4d469c; text-decoration: none;">ould not load NIB in bundle: 'NSBundle</a></li>
<li></li>
</ul>
</div>
<div style="text-align: -webkit-auto; text-indent: 0px;">
<br /></div>
<div style="text-align: -webkit-auto; text-indent: 0px;">
<ul class="posts" style="border-width: 0px; list-style: none none; margin: 0px; padding: 0px; text-align: left; text-indent: -15px;">
<li style="background-image: none; border-top-style: none; border-width: 0px; color: #666666; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 15px; list-style: none outside none; margin: 0.25em 0px; padding: 0.25em 15px 0.25em 1.3em;"><a href="http://iph00ne.blogspot.jp/2012/12/unrecognized-selector-sent-to-class.html" style="background-color: white; color: #4d469c; text-decoration: none;">unrecognized selector sent to class エラー??</a></li>
<li></li>
<li></li>
</ul>
</div>
</div>
Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-90750651842213217892013-02-16T20:08:00.003+09:002013-02-16T20:11:17.489+09:00シミュレータがいきなり使えなくなった(No provisioned iOS devices are available with a )<span style="font-family: Menlo; font-size: 11px; text-indent: -12px;">Code Sign error: The identity 'iPhone Developer' doesn't match any valid, non-expired certificate/private key pair in your keychains</span><br />
<div style="font-family: Menlo; font-size: 11px; margin-left: 12px; text-indent: -12px;">
<br />
<br />
<br />
No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination.<br />
<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-EcgJaFY88Aw/UR9nVc44RpI/AAAAAAAAAFk/gq2zghqOz1s/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-02-16+19.59.42.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="146" src="http://3.bp.blogspot.com/-EcgJaFY88Aw/UR9nVc44RpI/AAAAAAAAAFk/gq2zghqOz1s/s640/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-02-16+19.59.42.png" width="640" /></a></div>
<br />
<br />
<br />
こんなエラーがでて、あたふたしました。<br />
<br />
ググっても全然わからない!!<br />
<br />
Developer登録とかしていないし。。。<br />
<br />
証明書とか作成した記憶もない。。。<br />
<br />
とりあえず、シミュレータが起動する他のプロジェクトと比較した結果。。。<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-mIbAREizcsk/UR9n0ox3zAI/AAAAAAAAAFs/cIJapI4w1d4/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-02-16+20.04.27.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="164" src="http://2.bp.blogspot.com/-mIbAREizcsk/UR9n0ox3zAI/AAAAAAAAAFs/cIJapI4w1d4/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-02-16+20.04.27.png" width="400" /></a></div>
<br />
<br />
このラベル??がiOS Deviceになっていたので、iPhoneを選択すると、<br />
問題解決いたしました。<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-OpmbWBc_a0M/UR9oeKIE8PI/AAAAAAAAAF0/JkEkupzW4ig/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-02-16+20.07.09.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="112" src="http://3.bp.blogspot.com/-OpmbWBc_a0M/UR9oeKIE8PI/AAAAAAAAAF0/JkEkupzW4ig/s640/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-02-16+20.07.09.png" width="640" /></a></div>
<div>
<br /></div>
<br />
<br />
<br />
原因はわかりませんが、自分はこの問題2回目で、<br />
やっと解決できました。。<br />
<br />
前回このエラーが出た時は1からプロジェクトを再作成しました。<br />
はい。<br />
<br />
<br />
<br />Objective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0tag:blogger.com,1999:blog-5253095479472592215.post-13020238293859625882013-02-12T23:58:00.001+09:002013-02-12T23:58:08.515+09:00ould not load NIB in bundle: 'NSBundle<b style="font-family: Menlo; font-size: 11px;">Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </b>
<br />
<br />
<br />
というエラーが出現!!<br />
<br />
storyboardが良くないときにおこるエラーのようです。<br />
<br />
うーん。。<br />
<br />
わからないObjective-C,VBAhttp://www.blogger.com/profile/14358849823288466175noreply@blogger.com0