<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3054030883034606642</id><updated>2024-11-01T19:41:47.358+09:00</updated><category term="iPhone"/><category term="バーコドバトラーアプリ制作過程"/><category term="英語"/><category term="音楽"/><title type='text'>Pilgrims〜フリーランスプログラマの日記〜</title><subtitle type='html'>渋谷の某ITベンチャーで働いておりましたが、2014年2月独立し、フリーランスとなりました。iPhoneやAndroidなどのアプリ開発やってます。&#xa;日々の雑記や開発日記などなど…</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-2172030895894194713</id><published>2016-02-17T17:28:00.001+09:00</published><updated>2016-02-17T17:28:44.735+09:00</updated><title type='text'>CognitoIdentityCredentials is not authorized to perform: SNS:CreatePlatformEndpoint on resource</title><content type='html'>







&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;Error Domain=com.amazonaws.AWSSNSErrorDomain Code=4 &quot;(null)&quot; UserInfo={Type=Sender, Message=User: arn:aws:sts::760948203691:assumed-role/Cognito_TokyoCasinoUnauth_Role/CognitoIdentityCredentials is not authorized to perform: SNS:CreatePlatformEndpoint on resource: arn:aws:sns:ap-northeast-1:760948203691:app/APNS_SANDBOX/tokyo-casino, Code=AuthorizationError, __text=(&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &quot;\n&amp;nbsp; &amp;nbsp; &quot;,&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &quot;\n&amp;nbsp; &amp;nbsp; &quot;,&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &quot;\n&amp;nbsp; &amp;nbsp; &quot;,&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &quot;\n&amp;nbsp; &quot;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;)}&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;box-sizing: border-box; margin-bottom: 1em; margin-top: 0px; padding-left: 1.5em;&quot;&gt;&lt;br /&gt;
&lt;li style=&quot;background-color: white; box-sizing: border-box; list-style-type: decimal;&quot;&gt;&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;CognitoとSNSは同一のregionを指定。異なるregion(例:CognitoはUS、SNSはTokyo)だとエラーになり、エンドポイントは登録されない&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: white; box-sizing: border-box; list-style-type: decimal;&quot;&gt;&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 1.7;&quot;&gt;Cognitoの「&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 1.7;&quot;&gt;Edit identity pool」から「&lt;/span&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;Unauthenticated role&lt;/span&gt;&lt;span style=&quot;line-height: 1.7;&quot;&gt;」と「&lt;/span&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;Authenticated role&lt;/span&gt;&lt;span style=&quot;line-height: 1.7;&quot;&gt;」にセットされてるロールをチェック&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: white; box-sizing: border-box; list-style-type: decimal;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 1.7;&quot;&gt;IAMのロールから上記で確認したロールを編集する&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: white; box-sizing: border-box; list-style-type: decimal;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 1.7;&quot;&gt;編集内容は「インラインポリシー」でポリシーの編集から「&lt;/span&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;sns:CreatePlatformEndpoint&lt;/span&gt;&lt;span style=&quot;line-height: 1.7;&quot;&gt;」とSNSにあった&lt;/span&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;ARNs&lt;/span&gt;&lt;span style=&quot;line-height: 1.7;&quot;&gt;を設定&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;こんな感じで&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;
{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;Version&quot;: &quot;2012-10-17&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;Statement&quot;: [&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Effect&quot;: &quot;Allow&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Action&quot;: [&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;mobileanalytics:PutEvents&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;cognito-sync:*&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;sns:CreatePlatformEndpoint&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;sns:SetEndpointAttributes&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;sns:Subscribe&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;sns:Unsubscribe&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ],&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Resource&quot;: [&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;arn:*****************&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;arn:*****************&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; ]&lt;br /&gt;}&lt;/blockquote&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;参考サイト↓&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #4a4a4a; font-family: Helvetica Neue, Helvetica, ヒラギノ角ゴ ProN W3, Hiragino Kaku Gothic ProN, メイリオ, Meiryo, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 27.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px; color: #222426; font-family: Arial, &#39;Helvetica Neue&#39;, Helvetica, sans-serif; font-size: 22px; line-height: 1.3; margin: 0px 0px 0.5em; padding: 0px;&quot;&gt;
&lt;a class=&quot;question-hyperlink&quot; href=&quot;http://stackoverflow.com/questions/31064686/aws-push-notification-service-integration-error&quot; style=&quot;border: 0px; color: #222426; cursor: pointer; font-size: 24px; font-weight: normal; line-height: 1.35; margin: 0px 0px 0.5em; padding: 0px; text-decoration: none;&quot;&gt;AWS push notification service integration error&lt;/a&gt;&lt;/h1&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/2172030895894194713/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2016/02/cognitoidentitycredentials-is-not.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/2172030895894194713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/2172030895894194713'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2016/02/cognitoidentitycredentials-is-not.html' title='CognitoIdentityCredentials is not authorized to perform: SNS:CreatePlatformEndpoint on resource'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-656889606641355158</id><published>2015-05-12T20:52:00.001+09:00</published><updated>2015-05-12T20:52:59.293+09:00</updated><title type='text'>php-mecabをMAMPに導入する</title><content type='html'>軽いノリでMAMPにphp-mecab入れようとしたらつまずいてしまった。&lt;br /&gt;
&lt;br /&gt;
フツーにコマンドラインからは動かせて、mac内のPHPからもphp-mecabは動かせた。&lt;br /&gt;
たかがMAMPごときにphp-mecab入れられなくてもいいんだけど、たかがMAMPごときに入れることすらできないのも癪なので調べてやってみた。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://ameblo.jp/systemtelescope/entry-11885856445.html&quot; target=&quot;_blank&quot;&gt;ローカルでCakePHPを動かしてmecab_splitを使ってみる（mac）&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
上記の通りやってみるとMAMPでは動かない。&lt;br /&gt;
macのphpにmecabは入るが、mampには入りません。&lt;br /&gt;
&lt;br /&gt;
まず&lt;br /&gt;
/Applications/MAMP/bin/php/php5.〜/include&lt;br /&gt;
というディレクトリを作る&lt;br /&gt;
&lt;br /&gt;
次に自身が使用しているphpのソースをネットから落としてくる。&lt;br /&gt;
落としてきたフォルダ「php5.〜」を「php」にリネーム&lt;br /&gt;
/Applications/MAMP/bin/php/php5.〜/include/&lt;br /&gt;
に設置する。&lt;br /&gt;
&lt;br /&gt;
設置したphpファイル内で./configureを実行&lt;br /&gt;
cd /Applications/MAMP/bin/php/php5.〜/includes/php&lt;br /&gt;
./configure --with-php-config=/Applications/MAMP/bin/php/php5.〜/bin/php-config&lt;br /&gt;
&lt;br /&gt;
これで(mampのphpで)「phpize」コマンドが使用できる。&lt;br /&gt;
&lt;br /&gt;
あとは上記で示したリンクの通りに、&lt;br /&gt;
$ wget https://github.com/downloads/rsky/php-mecab/php-mecab-0.5.0.tgz&lt;br /&gt;
$ tar xzvf php-mecab-0.5.0.tgz&lt;br /&gt;
$ cd php-mecab-0.5.0&lt;br /&gt;
$&amp;nbsp;/Applications/MAMP/bin/php/php5.〜/bin/phpize&lt;br /&gt;
$ ./configure --with-php-config=/Applications/MAMP/bin/php/php5.〜/bin/php-config --with-mecab=/usr/local/bin/mecab-config&lt;br /&gt;
$ make&lt;br /&gt;
$ make install&lt;br /&gt;
&lt;br /&gt;
でオッケー。php.iniにextensionの追加も忘れずに。</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/656889606641355158/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2015/05/php-mecabmamp.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/656889606641355158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/656889606641355158'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2015/05/php-mecabmamp.html' title='php-mecabをMAMPに導入する'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-3490915502292239095</id><published>2014-09-16T18:04:00.000+09:00</published><updated>2014-09-16T18:04:19.938+09:00</updated><title type='text'>unacceptable content-type: text/html</title><content type='html'>unacceptable content-type: text/htmlエラーがでました。&lt;br /&gt;&lt;a href=&quot;http://stackoverflow.com/questions/19114623/request-failed-unacceptable-content-type-text-html-using-afnetworking-2-0&quot;&gt;AFNetworking 2.0&lt;/a&gt;を使用している時に。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;以下に解決策&lt;br /&gt;&lt;a href=&quot;http://stackoverflow.com/questions/19114623/request-failed-unacceptable-content-type-text-html-using-afnetworking-2-0&quot;&gt;Request failed: unacceptable content-type: text/html using AFNetworking 2.0&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; &lt;br /&gt;    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@&quot;text/html&quot;];&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
許可するコンテンツタイプに&quot;text/html&quot;を追加してやれば良いらしいですね。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/3490915502292239095/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2014/09/unacceptable-content-type-texthtml.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/3490915502292239095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/3490915502292239095'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2014/09/unacceptable-content-type-texthtml.html' title='unacceptable content-type: text/html'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-3228750892826412910</id><published>2014-09-16T12:29:00.001+09:00</published><updated>2014-09-16T12:29:50.366+09:00</updated><title type='text'>After modifying system headers, please delete the module cache  at &#39;/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache/〜&#39;</title><content type='html'>表題のエラーが出た。&lt;br /&gt;&lt;br /&gt;該当ディレクトリのキャッシュを消せとのことで、&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://qiita.com/katryo/items/298159fb44524bba1bd8&quot; target=&quot;_blank&quot;&gt;Xcodeに&quot;After modifying system headers, please delete the module cache at ...&quot; と言われたときの対応&lt;/a&gt;&lt;br /&gt;
&lt;div id=&quot;fastlookup_top&quot; style=&quot;display: none;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
上記ブログではcacheディレクトリ配下全てのキャッシュを消していた。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
ディレクトリ配下はちょっと…でもどう見ても指定されている意味不明なアルファベットの羅列のディレクトリがなかったのでとりあえずプロジェクトをクリーン=&amp;gt;治りました。&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/3228750892826412910/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2014/09/after-modifying-system-headers-please.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/3228750892826412910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/3228750892826412910'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2014/09/after-modifying-system-headers-please.html' title='After modifying system headers, please delete the module cache  at &#39;/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache/〜&#39;'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-7722797999361160416</id><published>2014-07-09T18:31:00.003+09:00</published><updated>2014-07-09T18:31:48.656+09:00</updated><title type='text'>ExpandableListViewが開かない問題</title><content type='html'>BaseExpandableListAdapterを継承した独自のExpandableListViewを使用していて、GroupViewは表示されるのだが、ChildViewが一切表示されない。&lt;br /&gt;
&lt;br /&gt;
getChildViewどころかgetChild、getChildrenCountすら呼ばれない、、&lt;br /&gt;
&lt;br /&gt;
はて困った、、のだがこの記事&lt;a href=&quot;http://stackoverflow.com/questions/7754753/expandablelistview-does-not-append-the-childs&quot; target=&quot;_blank&quot;&gt;（stackoverflow http://stackoverflow.com/questions/7754753/expandablelistview-does-not-append-the-childs）&lt;/a&gt;の一番下に、&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;For the records, the problem was the ImageButton in the group layout. I dont know why, but removing it i solved the problem. &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
とのこと。 たしかに僕もGroupViewないにbutton入れてた。&lt;br /&gt;
外したらきちんと開けました。。&lt;br /&gt;
&lt;br /&gt;
これは確かに I dont know why. だわ。 &lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/7722797999361160416/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2014/07/expandablelistview.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/7722797999361160416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/7722797999361160416'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2014/07/expandablelistview.html' title='ExpandableListViewが開かない問題'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-6140030719099684480</id><published>2014-04-10T21:03:00.000+09:00</published><updated>2014-04-10T21:03:09.905+09:00</updated><title type='text'>Uncaught TypeError: Object [object Object] has no method &#39;〜&#39;エラー</title><content type='html'>&lt;div&gt;
久しぶりにやったらwebviewからjsの関数の戻り値を取れなくて、&lt;/div&gt;
&lt;div&gt;
表題のエラーがでてくる。ずっとごにょごにょやってたんだけど、ググったら一発でしたわ。あれこれ悩むよりまえにググったほうがええな。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
stackoverflowにいっぱい記事があった。&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;i&gt;&lt;a href=&quot;http://stackoverflow.com/questions/14031635/android-4-2-1-webview-and-javascript-interface-breaks&quot; target=&quot;_blank&quot;&gt;From the Android 4.2 documentation:&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;a href=&quot;http://stackoverflow.com/questions/14031635/android-4-2-1-webview-and-javascript-interface-breaks&quot; target=&quot;_blank&quot;&gt;Caution: If you&#39;ve set your targetSdkVersion to 17 or higher, you must add the @JavascriptInterface annotation to any method that you want available your web page code (the method must also be public). If you do not provide the annotation, then the method will not accessible by your web page when running on Android 4.2 or higher.&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;sdkのターゲットが17以上の場合は@JavascriptInterfaceアノテーションをつけないとだめらしい。きちんと別ファイルに&lt;/i&gt;&lt;i&gt;JavascriptInterface用のクラス作成して、アノテーションを付けて、メソッドはパブリックに指定してやる。&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;それでいけました。&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;div&gt;
import android.webkit.JavascriptInterface;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
public class CustomJavascriptInterface {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@JavascriptInterface&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void getReturnString(String returnValue) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.d(&quot;jsの戻り値 =&amp;gt; &quot;, returnValue);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/6140030719099684480/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2014/04/uncaught-typeerror-object-object-object.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/6140030719099684480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/6140030719099684480'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2014/04/uncaught-typeerror-object-object-object.html' title='Uncaught TypeError: Object [object Object] has no method &#39;〜&#39;エラー'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-19511673883556758</id><published>2014-04-08T17:41:00.001+09:00</published><updated>2014-04-08T17:41:47.201+09:00</updated><title type='text'></title><content type='html'>webアプリを作っている時に、&lt;br /&gt;
uinavigation contrllerの中にwebview突っ込んで、&lt;br /&gt;
もどるボタンでwebviewのもどるを実装したいとき多々あります。&lt;br /&gt;
&lt;br /&gt;
もどるボタンをキャッチする方法、いろいろあるみたいだけど、&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/5217992/back-button-callback-in-navigationcontroller-in-ios&quot;&gt;http://stackoverflow.com/questions/5217992/back-button-callback-in-navigationcontroller-in-ios&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ベーシックなやり方がなんだかんだ安心するわ&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
- (&lt;span class=&quot;s1&quot;&gt;void&lt;/span&gt;)viewDidLoad&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
{&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; [&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;viewDidLoad&lt;span class=&quot;s2&quot;&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;UIBarButtonItem&lt;span class=&quot;s2&quot;&gt; *backButton = [[&lt;/span&gt;UIBarButtonItem&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;alloc&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;initWithTitle&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;@&quot;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;戻る&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s3&quot;&gt;style&lt;/span&gt;:&lt;span class=&quot;s3&quot;&gt;UIBarButtonItemStyleBordered&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s3&quot;&gt;target&lt;/span&gt;:&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s3&quot;&gt;action&lt;/span&gt;:&lt;span class=&quot;s1&quot;&gt;@selector&lt;/span&gt;(handleBack:)];&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;navigationItem&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;leftBarButtonItem&lt;span class=&quot;s2&quot;&gt; = backButton;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s6&quot;&gt;_webview&lt;/span&gt;.&lt;span class=&quot;s7&quot;&gt;delegate&lt;/span&gt; = &lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s7&quot;&gt;NSURL&lt;/span&gt; *url = [&lt;span class=&quot;s7&quot;&gt;NSURL&lt;/span&gt; &lt;span class=&quot;s3&quot;&gt;URLWithString&lt;/span&gt;:&lt;span class=&quot;s6&quot;&gt;_url&lt;/span&gt;];&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;NSURLRequest&lt;span class=&quot;s2&quot;&gt; *req = [&lt;/span&gt;NSURLRequest&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;requestWithURL&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:url];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; [&lt;span class=&quot;s6&quot;&gt;_webview&lt;/span&gt; &lt;span class=&quot;s3&quot;&gt;loadRequest&lt;/span&gt;:req];&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
























&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
}&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
- (&lt;span class=&quot;s1&quot;&gt;void&lt;/span&gt;) handleBack:(&lt;span class=&quot;s1&quot;&gt;id&lt;/span&gt;)sender&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
{&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;([&lt;span class=&quot;s5&quot;&gt;_webview&lt;/span&gt; &lt;span class=&quot;s3&quot;&gt;canGoBack&lt;/span&gt;]){&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&lt;span class=&quot;s5&quot;&gt;_webview&lt;/span&gt; &lt;span class=&quot;s3&quot;&gt;goBack&lt;/span&gt;];&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;span class=&quot;s1&quot;&gt;else&lt;/span&gt;{&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;navigationController&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;popToRootViewControllerAnimated&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;YES&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;

















&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;fastlookup_top&quot; style=&quot;display: none;&quot;&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/19511673883556758/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2014/04/web-uinavigation-contrllerwebview.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/19511673883556758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/19511673883556758'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2014/04/web-uinavigation-contrllerwebview.html' title=''/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-6860744056728580472</id><published>2014-04-08T16:27:00.001+09:00</published><updated>2014-04-08T16:27:34.443+09:00</updated><title type='text'>storyboard 接続できない</title><content type='html'>xcodeでiOSの開発をしていて、storyboardでボタンから次のviewcontrollerに紐付け付ができなくなりました。&lt;br /&gt;
&lt;br /&gt;
ctrlキー+ドラッグでビョーンと伸ばしても、ひも付きがなされない。&lt;br /&gt;
&lt;br /&gt;
=&amp;gt;xcode再起動でなおりました。&lt;br /&gt;
&lt;div id=&quot;fastlookup_top&quot;&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/6860744056728580472/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2014/04/storyboard.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/6860744056728580472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/6860744056728580472'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2014/04/storyboard.html' title='storyboard 接続できない'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-1864635899205015049</id><published>2013-12-17T19:16:00.000+09:00</published><updated>2013-12-17T19:16:36.252+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="音楽"/><title type='text'>traktor s4購入しました</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUR9GQvA2zlzSsjpkSDJWkPudQdD2UoIsEHq5I9DZol-HMQRKhIPxKBxYGOMqYU6AnktHjGgn5smVRsa10Jloj-ij1Z513c7_-y8vVQvfj1wth8fPr56LydPPrm1c-9rLeUx-Vw8OwQQY/s640/blogger-image-811491542.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUR9GQvA2zlzSsjpkSDJWkPudQdD2UoIsEHq5I9DZol-HMQRKhIPxKBxYGOMqYU6AnktHjGgn5smVRsa10Jloj-ij1Z513c7_-y8vVQvfj1wth8fPr56LydPPrm1c-9rLeUx-Vw8OwQQY/s400/blogger-image-811491542.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
でで〜ん！！！！&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
か、かっこいい、、&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
大金はたいて買ってしまいました！S4！&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
パソコンの中の音源を使ってDJできるPCDJってやつね。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
SL1200とかレコードも考えたんだけど、レコードはでかいし買うの大変そうだしで、集める前に挫折したらいやだったのでこっちにしました。（S4もでかいけど、ターンテーブルは更にでかいしね。。）&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
もともとダンスやってるんですけど、ダンスの歴史とか少しずつ調べてたらクラブカルチャーにも興味が湧いて来て、そもそもクラブにもちょいちょい行くし、もっと真剣に音楽に向き合わなくちゃな〜と考えた結果がこれです。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
少しいじってみたけど凄い楽しい。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
今は年末の忙しい時期で全然触れてないんだけど、仕事が落ち着いたらいじり倒したいところ☆&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/1864635899205015049/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2013/12/traktor-s4.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/1864635899205015049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/1864635899205015049'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2013/12/traktor-s4.html' title='traktor s4購入しました'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUR9GQvA2zlzSsjpkSDJWkPudQdD2UoIsEHq5I9DZol-HMQRKhIPxKBxYGOMqYU6AnktHjGgn5smVRsa10Jloj-ij1Z513c7_-y8vVQvfj1wth8fPr56LydPPrm1c-9rLeUx-Vw8OwQQY/s72-c/blogger-image-811491542.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-5899451288371970164</id><published>2013-09-20T01:23:00.000+09:00</published><updated>2013-09-20T01:23:40.006+09:00</updated><title type='text'>レアジョブ反省日記 13/9/19</title><content type='html'>本日の教材&lt;br /&gt;
Daily news article&amp;nbsp;[&lt;a href=&quot;http://rarejobdailynewsarticle.blogspot.jp/2013/09/palestinian-man-got-stuck-in-airport.html&quot; target=&quot;_blank&quot;&gt;Palestinian Man Got Stuck in an Airport&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
わからなかった単語&lt;br /&gt;
・refugee&lt;br /&gt;
亡命者&lt;br /&gt;
&lt;br /&gt;
・monotonous&lt;br /&gt;
くっそ退屈ってこと。形容詞&lt;br /&gt;
&lt;br /&gt;
・fix&lt;br /&gt;
固定するって意味の動詞しか知らんかった。&lt;br /&gt;
苦境とか困難って意味もあったんやな。。&lt;br /&gt;
&lt;br /&gt;
・asylum&lt;br /&gt;
亡命とか保護施設って意味らしい。アサイラムってなんか聞いたことあったな、アームズだったかな？？&lt;br /&gt;
&lt;br /&gt;
・Palestinian&lt;br /&gt;
パレスチナ人。パレスチニアン。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
映画ターミナルみたいな境遇の人の話だった。トム・ハンクスが出てるやつ。&lt;br /&gt;
自分だったらどうするみたいなことを聞かれて、「環境は関係なくて、幸せかどうかはその人が決める」みたいなことを説明したかったのだが苦戦した。&lt;br /&gt;
&lt;br /&gt;
depending on how you look at it&lt;br /&gt;
depending on the perspective ［point of view］ of&lt;br /&gt;
&lt;br /&gt;
この辺りをつかえばよかったか。&lt;br /&gt;
Situation is not problem. Whether you feel happy or not depending on how you look at it.&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;fastlookup_top&quot; style=&quot;display: none;&quot;&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/5899451288371970164/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2013/09/13919.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/5899451288371970164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/5899451288371970164'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2013/09/13919.html' title='レアジョブ反省日記 13/9/19'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-7369377613752106563</id><published>2013-08-28T12:39:00.001+09:00</published><updated>2013-08-28T12:39:30.300+09:00</updated><title type='text'>デザインパターンのお勉強【Strategyパターン】</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
今まで一切触れたこともなかったので、そろそろデザインパターンの勉強しよう。すぐに忘れてしまいそうであるので頭を整理するためにもブログに記載しようと思う。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
まずはStrategyパターン。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
アルゴリズムを実行時に選択できるようにするデザインパターン。このパターンは第一級関数言語だと関数自体を第一級オブジェクトとして扱えるので（アルゴリズムは選びたい放題や！）、暗黙のまま使用されていることになる。Pythonとかjsとか。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/0/08/StrategyPatternClassDiagram.svg/500px-StrategyPatternClassDiagram.svg.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/0/08/StrategyPatternClassDiagram.svg/500px-StrategyPatternClassDiagram.svg.png&quot; style=&quot;background-color: #f9f9f9;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Strategy パターンを示す図（引用：&lt;a href=&quot;http://ja.wikipedia.org/wiki/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB:StrategyPatternClassDiagram.svg&quot; target=&quot;_blank&quot;&gt;Wikipedia&lt;/a&gt;）&lt;/div&gt;
&lt;br /&gt;
上記はオブジェクト指向言語の場合のStrategyｐを表す図。&lt;br /&gt;
&lt;div&gt;
ContextがStrategy Classをインスタンスに持っていて（合成）&lt;br /&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;kw3&quot; style=&quot;color: #003399;&quot;&gt;Context&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
    Strategy strategy&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
 
    &lt;span class=&quot;co1&quot; style=&quot;color: #666666; font-style: italic;&quot;&gt;// Constructor&lt;/span&gt;
    &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw3&quot; style=&quot;color: #003399;&quot;&gt;Context&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;IStrategy strategy&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;strategy&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; strategy&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
 
    &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;void&lt;/span&gt; execute&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
      strategy.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
StrategyはInterfaceで実装はConcreateStrategyAやConcreateStrategyBに記載する。&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;interface&lt;/span&gt; Strategy &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;void&lt;/span&gt; execute&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
 
  &lt;span class=&quot;co1&quot; style=&quot;color: #666666; font-style: italic;&quot;&gt;// strategyインターフェイスを用いたアルゴリズムの実装&lt;/span&gt;
  &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;class&lt;/span&gt; ConcreteStrategyA &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;implements&lt;/span&gt; Strategy &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;void&lt;/span&gt; execute&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kw3&quot; style=&quot;color: #003399;&quot;&gt;System&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;st0&quot; style=&quot;color: blue;&quot;&gt;&quot;Called ConcreteStrategyA.execute()&quot;&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
 
  &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;class&lt;/span&gt; ConcreteStrategyB &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;implements&lt;/span&gt; Strategy  &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;void&lt;/span&gt; execute&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kw3&quot; style=&quot;color: #003399;&quot;&gt;System&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;st0&quot; style=&quot;color: blue;&quot;&gt;&quot;Called ConcreteStrategyB.execute()&quot;&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
 
  &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;class&lt;/span&gt; ConcreteStrategyC &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;implements&lt;/span&gt; Strategy &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;void&lt;/span&gt; execute&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kw3&quot; style=&quot;color: #003399;&quot;&gt;System&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;st0&quot; style=&quot;color: blue;&quot;&gt;&quot;Called ConcreteStrategyC.execute()&quot;&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
使用する際にはContextのオブジェクトを生成するときにどの実装を採用するか選択する（上記の例だとConcreateStrategyAとかConcreateStrategyB）&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;context &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;kw3&quot; style=&quot;color: #003399;&quot;&gt;Context&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;new&lt;/span&gt; ConcreteStrategyA&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
    context.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
 
    context &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;kw3&quot; style=&quot;color: #003399;&quot;&gt;Context&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;new&lt;/span&gt; ConcreteStrategyB&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
    context.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
 
    context &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;kw3&quot; style=&quot;color: #003399;&quot;&gt;Context&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;new&lt;/span&gt; ConcreteStrategyC&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
    context.&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
このStrategyパターンの利点としては、継承を利用するよりも変更に強い（らしい）&lt;br /&gt;例えば生き物クラスを継承して、人間クラス、鳥クラス、犬クラスetcを作成してそれぞれに「つかむ」メソッドを実装したいとする。&lt;br /&gt;&lt;br /&gt;
「つかむ」メソッドには「手でつかむ」「くちばしでつかむ」「前足でつかむ」など色々な方法があり、これを各生き物のサブクラスごとに実装する必要がある。&lt;br /&gt;&lt;br /&gt;「手でつかむ」ことができるサブクラスには全てそのメソッドを記述する必要があり（重複）、変更が存在したときにはまたそのすべてを修正しなければならない（変更が面倒）。&lt;br /&gt;&lt;br /&gt;しかしStrategyパターンを用いれば、各つかみ方を動的に変更してやればよい。&lt;/div&gt;
&lt;div&gt;
grabBehavior = new grabByHand();&lt;br /&gt;&lt;br /&gt;しかも「手でつかむ」メソッドに変更が生じても、そのメソッド内を変更するだけで、各生き物サブクラスの実装の内部を変更する必要がない。生き物のサブクラスが例えば何十個もあるような場合は非常にメンテナンスに差がつくことになる。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/7369377613752106563/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2013/08/strategy.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/7369377613752106563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/7369377613752106563'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2013/08/strategy.html' title='デザインパターンのお勉強【Strategyパターン】'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-2674730964203572991</id><published>2013-08-13T10:14:00.000+09:00</published><updated>2013-08-13T10:15:00.448+09:00</updated><title type='text'>UIWebViewのshouldStartLoadWithRequestにて、iframeと画面遷移の違いを把握する</title><content type='html'>ブラウザとネイティブの連携なんかをやっていると、UIWebviewなんかでshouldStartLoadWithRequestが何度も呼ばれて困ったりします。&lt;br /&gt;
&lt;br /&gt;
iframeとかが入っていると数回呼ばれてしまうらしいのですが、これを場合分けする方法。&lt;br /&gt;
&lt;br /&gt;
(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType&lt;br /&gt;
{&lt;br /&gt;
&lt;span style=&quot;color: yellow;&quot;&gt;&amp;nbsp; &amp;nbsp; BOOL isFrame = ![[[request URL] absoluteString] isEqualToString:[[request mainDocumentURL] absoluteString]];&lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
これでいけます。&lt;br /&gt;
まんまこれのパクリですが、、&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://stackoverflow.com/questions/1218493/how-to-tell-the-difference-between-an-iframe-loading-vs-entire-page-loading-in&quot; target=&quot;_blank&quot;&gt;How to tell the difference between an iframe loading vs. entire page loading in a UIWebView?&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/2674730964203572991/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2013/08/uiwebviewshouldstartloadwithrequestifra.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/2674730964203572991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/2674730964203572991'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2013/08/uiwebviewshouldstartloadwithrequestifra.html' title='UIWebViewのshouldStartLoadWithRequestにて、iframeと画面遷移の違いを把握する'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-4900062110916871114</id><published>2013-07-22T00:58:00.003+09:00</published><updated>2013-07-22T10:13:01.809+09:00</updated><title type='text'>海外の英語学習サイト</title><content type='html'>rarejobの先生から英語学習関連のURLを大量にもらったので、ここにメモしておく。&lt;br /&gt;
&lt;br /&gt;
まだ中身は見てないんだけど、やってみたらちょいちょいコメント追加します。&lt;br /&gt;
&lt;br /&gt;
INTERMEDIATE VOCABULARY&lt;br /&gt;http://www.oup.com/elt/global/products/englishfile/upperint/b_vocabulary/ &lt;br /&gt;http://www.englishdaily626.com/slang.php?012 &lt;br /&gt;http://www.vocaboly.com/vocabulary-test/ &lt;br /&gt;http://www.autoenglish.org/vocab.htm &lt;br /&gt;http://elc.polyu.edu.hk/cill/eap/wordlists.htm &lt;br /&gt;http://esl.about.com/od/vocabularyintermediate/Vocabulary_for_Intermediate_Level_English_Learners.htm &lt;br /&gt;http://www.esl-classroom.com/vocabulary/vindex.html &lt;br /&gt;http://www.eslgold.com/vocabulary/high_intermediate.html&lt;br /&gt;&lt;br /&gt;INTERMEDIATE GRAMMAR&lt;br /&gt;http://www.englishmedialab.com/intermediatequiz.html &lt;br /&gt;http://www.eslgold.com/grammar/low_intermediate.html &lt;br /&gt;http://www.nonstopenglish.com/allexercises/ &lt;br /&gt;http://englishonline.sites.uol.com.br/english/intermediate.htm &lt;br /&gt;http://www.learnenglish.be/ &lt;br /&gt;http://web2.uvcs.uvic.ca/courses/elc/studyzone/ &lt;br /&gt;http://free-english-study.com/home/grammar-index.html &lt;br /&gt;http://www.eslgold.com/grammar/high_intermediate.html&lt;br /&gt;&lt;br /&gt;INTERMEDIATE PRONUNCIATION&lt;br /&gt;http://www.oup.com/elt/global/products/englishfile/upperint/c_pronunciation/ &lt;br /&gt;http://elc.polyu.edu.hk/cill/pronunci.htm &lt;br /&gt;http://www.bbc.co.uk/worldservice/learningenglish/grammar/pron/ &lt;br /&gt;http://www.learnersdictionary.com/pronex/pronex.htm &lt;br /&gt;http://www.speak-read-write.com/minimalpairs.html &lt;br /&gt;http://esl.about.com/od/speakingenglish/a/a_stressinto.htm &lt;br /&gt;http://www.englishelearning.com/ &lt;br /&gt;http://www.autoenglish.org/pronunciation.htm&lt;br /&gt;&lt;br /&gt;INTERMEDIATE LISTENING&lt;br /&gt;http://www.ompersonal.com.ar/omaudio/contenidotematico.htm &lt;br /&gt;http://www.ezslang.com/ &lt;br /&gt;http://www.dictationsonline.com/ &lt;br /&gt;http://www.5minuteenglish.com/listening.htm &lt;br /&gt;http://esl.about.com/od/intermediatelistenin1/Listening_Skills_for_Intermediate_Level_English_Learners.htm&lt;br /&gt;http://esl.about.com/od/podcasts/Podcasts_for_English_Learning_and_Teaching.htm &lt;br /&gt;http://www.esl-lab.com/ http://blabbinit.com/category/podcast/podcast</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/4900062110916871114/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2013/07/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/4900062110916871114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/4900062110916871114'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2013/07/blog-post.html' title='海外の英語学習サイト'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-3842818969382706391</id><published>2013-07-08T21:59:00.001+09:00</published><updated>2013-07-08T21:59:19.301+09:00</updated><title type='text'>htmlからbodyタグの中身だけ取得する正規表現【php】</title><content type='html'>if (preg_match(&#39;~&lt;body&gt;]*&amp;gt;(.*?)&lt;/body&gt;~si&#39;, $text, $body))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $body[1];&lt;br /&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
参考サイトは&lt;a href=&quot;https://forums.digitalpoint.com/threads/how-can-i-extract-all-text-in-html-page-between-the-body-body-tags.1560812/&quot; target=&quot;_blank&quot;&gt;こちら &lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/3842818969382706391/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2013/07/htmlbodyphp.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/3842818969382706391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/3842818969382706391'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2013/07/htmlbodyphp.html' title='htmlからbodyタグの中身だけ取得する正規表現【php】'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-4230318187879499614</id><published>2013-07-08T00:47:00.002+09:00</published><updated>2013-07-08T00:55:20.646+09:00</updated><title type='text'>paperclip エラーメッセージ</title><content type='html'>大した話ではないのだが、railsでpaperclipを使って画像をアップする際に、どのようにエラーメッセージを設定すればいいのか調べたのでメモ。&lt;br /&gt;
&lt;br /&gt;
てかこの&lt;a href=&quot;http://stackoverflow.com/questions/10711504/cleaning-up-paperclip-error-messages&quot; target=&quot;_blank&quot;&gt;stackoverflowの記事&lt;/a&gt;を見ただけなんだけどね。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;span style=&quot;color: #444444;&quot;&gt;avatar_is_a_image&lt;/span&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;avatar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; color: #444444; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;avatar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;content_type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/image/&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
        &lt;span style=&quot;color: #444444;&quot;&gt;errors&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;avatar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Avatar must be an image&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;span style=&quot;color: #444444;&quot;&gt;avatar_is_less_than_two_megabytes&lt;/span&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;avatar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;avatar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;size &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;5.megabytes&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
        &lt;span style=&quot;color: #444444;&quot;&gt;errors&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;avatar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Avatar must be less than 5 megabytes in size&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
こんなかんじでメソッドを作成してやればOK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;fastlookup_top&quot; style=&quot;display: none;&quot;&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/4230318187879499614/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2013/07/paperclip.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/4230318187879499614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/4230318187879499614'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2013/07/paperclip.html' title='paperclip エラーメッセージ'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-4583706373953013976</id><published>2013-06-08T23:25:00.005+09:00</published><updated>2015-04-21T17:45:33.357+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="英語"/><title type='text'>Subject and Verb Agreement Rules（主語と動詞の関係）</title><content type='html'>&lt;br /&gt;&lt;br /&gt;レアジョブでここ最近毎日スカイプで英会話をしているのだが、主語と動詞の関係でややこしいところがあったので忘備録としてここにまとめておきます。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. ２つの主語が 接続詞“and”でつながっている場合、動詞は複数形（例：Their application form and resume are〜）&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. ２つの主語が接続詞“and”でつながっていても、同じ対象を指している場合は動&lt;br /&gt;&lt;br /&gt;詞は単数形（例：Coat and tie is〜）&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. “each” “every” “no”が主語の前にくるときには、動詞は単数形（例：Every man and woman is〜）&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. 2つの主語が共に単数形で、接続詞で結ばれている場合、動詞も単数形。この時使われる接続詞の例としては、or,nor,either/or,neither/nor,そして not only/but also&lt;br /&gt;&lt;br /&gt;など（例：Neither Erica nor Helen goes〜）&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. 2つの主語が共に複数形で、接続詞で結ばれている場合、動詞も複数形（例：Either the supervisors or their subordinates gather〜）&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. or、nor、neither/nor、either/or、そして not only/but also などで接続された&lt;br /&gt;&lt;br /&gt;単数形の主語と複数形の主語が、文の中に共にある場合、動詞はより動詞に&lt;br /&gt;&lt;br /&gt;近い位置にある主語の数に一致（例：The chocolate chips or the egg is〜）&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. and で接続された 2 つの不定詞は、動詞の複数形と結びつく（例： To love and to laugh are〜）&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. パーセントや比率などの割合を示す名詞と代名詞の後には、前置詞句が来ることがあ&lt;br /&gt;&lt;br /&gt;る。この場合、前置詞の目的語が動詞の形式を決定する。このような名詞や代名&lt;br /&gt;&lt;br /&gt;詞の例としては、some、all、half、one third、none など&lt;br /&gt;&lt;br /&gt;（例）&lt;br /&gt;&lt;br /&gt;・Most of the applicants were〜&lt;br /&gt;&lt;br /&gt;・Half of the report was 〜&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;9. 時間の長さやその他の単位を表す表現には、動詞の単数形が必要（例：Three dollars is〜）&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10. each、each one、either、neither、everyone、everybody、anybody、anyone、&lt;br /&gt;&lt;br /&gt;nobody、somebody、someone、そして no one などの言葉は単数扱いで、動詞&lt;br /&gt;&lt;br /&gt;の単数形と結びつく（例：Everybody has〜）&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;11. Both、few、many、others、several は複数形の代名詞で、動詞の複数形と結&lt;br /&gt;&lt;br /&gt;びつく（例：Both girls are〜）&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;fastlookup_top&quot; style=&quot;display: none;&quot;&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/4583706373953013976/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2013/06/subject-and-verb-agreement-rules.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/4583706373953013976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/4583706373953013976'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2013/06/subject-and-verb-agreement-rules.html' title='Subject and Verb Agreement Rules（主語と動詞の関係）'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-1031974463281752813</id><published>2013-06-05T16:18:00.000+09:00</published><updated>2015-04-21T17:46:16.562+09:00</updated><title type='text'>your app contains non-public API usage.</title><content type='html'>&lt;span style=&quot;color: red;&quot;&gt;your app contains non-public API usage. Please review the errors, correct them, and resubmit your application.&lt;br /&gt;&lt;br /&gt;Apps are not permitted to access the UDID and must not use the uniqueIdentifier method of UIDevice.&lt;br /&gt;Please update your apps and servers to associate users with the Vendor or Advertising identifiers introduced in iOS 6.&lt;br /&gt;&lt;br /&gt;if you think this message was sent in error and that you have only used Appli-published APIs in accordance with the guidelines, send the app&#39;s&lt;br /&gt;nine-degit Apple ID, along with detaild information about why you believe the above APIs were incorrectly flagged, to appreview@apple.com.&lt;br /&gt;For further information, visit the Technical Support Information page at http://developer.apple.com/support/technical/.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
既存のiPhoneアプリを最近更新しようとしたらvalidationで上記のエラー。&lt;br /&gt;
&lt;br /&gt;
どうやら2013/5/1に規約が変更になったらしい。&lt;br /&gt;
UIDeviceのuniqueIdentifierメソッドを使用していると申請が通らないらしい。&lt;br /&gt;
&lt;br /&gt;
しかしアプリ内を検索してもどこにもuniqueIdentifierメソッドなんぞ使用していない様子。&lt;br /&gt;
&lt;br /&gt;
困っていたところでこの記事を見つけた&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/16489079/apps-are-not-permitted-to-access-the-udid-and-must-not-use-the-uniqueidentifier&quot; target=&quot;_blank&quot;&gt;Apps are not permitted to access the UDID and must not use the uniqueIdentifier method of UIDevice (stackoverflow)&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ターミナルでgrepしてみるとどうやら外部ライブラリのバイナリデータ内で使用されていた様子だ。&lt;br /&gt;
&lt;br /&gt;
ちなみにコマンドはこれ&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;find . | grep -v .svn&amp;nbsp; | grep &quot;\.a&quot; | grep -v &quot;\.app&quot; | xargs grep uniqueIdentifier &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
これは気づかなんだわ。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/1031974463281752813/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2013/06/your-app-contains-non-public-api-usage.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/1031974463281752813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/1031974463281752813'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2013/06/your-app-contains-non-public-api-usage.html' title='your app contains non-public API usage.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-2310280787774459654</id><published>2012-04-20T09:38:00.001+09:00</published><updated>2012-04-20T09:38:59.352+09:00</updated><title type='text'>二台目のmacへの移行アシスタンスでeclipseがエラー</title><content type='html'>&lt;br /&gt;
二台目のMacへ以前のPCの内容を引き継ごうと、移行アシスタンスを使いました。&lt;br /&gt;
そしたら、xcodeは大丈夫だったのですが（実機テストのための証明書やprovisiningの問題は発生しましたが）、eclispseに至っては起動すらできませんでした。&lt;br /&gt;
&lt;br /&gt;
初めはアクセス権のエラーメッセージがでていたので、修正してみたのですが、また別のメッセージが出て来てしまう。&lt;br /&gt;
↓こんなの&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
早速エラーメッセージでググってみたら同じことで悩んだ人がいました。&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
 &lt;a href=&quot;http://blog.collab-it.net/2011/09/maceclipse.html&quot;&gt;Mac買い替えユーザーのための移行アシスタントで出来ないEclipseの引っ越し方&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;これの通りで私もできました。&lt;/div&gt;
&lt;div&gt;
以前のmacのeclipseをフォルダごとdropboxにぶっ込んで、新しいmacでそのフォルダをアプリケーションフォルダに入れたら起動できました。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
よかったよかった。&lt;/div&gt;
&lt;div&gt;
開発そのものよりも開発環境の構築とかの方が神経使いますね…&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/2310280787774459654/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2012/04/maceclipse.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/2310280787774459654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/2310280787774459654'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2012/04/maceclipse.html' title='二台目のmacへの移行アシスタンスでeclipseがエラー'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-2482314342488430362</id><published>2011-08-07T17:00:00.001+09:00</published><updated>2015-04-21T17:49:48.172+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iPhone"/><category scheme="http://www.blogger.com/atom/ns#" term="バーコドバトラーアプリ制作過程"/><title type='text'>XMLパーサーの実装編〜iPhoneバーコードリーダーアプリ制作第５回〜</title><content type='html'>本日&lt;a href=&quot;http://jp.techcrunch.com/archives/jp20110728mediba-acquired-nobot/&quot;&gt;ノボットの買収&lt;/a&gt;をニュースで見てテンション上がりまくりです。&lt;br /&gt;
やはりきちんと実力のあるベンチャーが評価されるべきですよね。最近流行に便乗しただけのようなベンチャーが大量に資金を集めてたりするのはなんか違うな〜って思います。まあ日本のベンチャーを育てようってのはいい傾向なんですけどね。&lt;br /&gt;
&lt;br /&gt;
んでバーコードバトラーアプリの制作過程の第５回目です。&lt;br /&gt;
最近Androidアプリの開発ばっかやってるんで、ちょっとObjective-C忘れ気味ですがいきましょう！&lt;br /&gt;
&lt;br /&gt;
本日は楽天から取得したXMLをパースして、商品画像と商品タイトルを取得するとこまでやります。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-size: x-large;&quot;&gt;1 XMLパーサー（SAX）&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
まずはXMLパーサーについて少し解説します。パーサーってのはXML文章をプログラムで扱うための方法で、XMLから要素を取得したり、値を挿入したりすることができます。&lt;br /&gt;
パーサーには大きく分けて二つの種類があります。&lt;br /&gt;
DOMとSAXです。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;■DOM&lt;/b&gt;&lt;br /&gt;
DOMってのは簡単に説明すると、XMLの要素を全部読み込んで、要素のツリーを構築します。このツリー内を自由に行き来できて、要素を削除したり追加したりできるというメリットがあります。しかし一方で、XMLを全部一気に読み込むのでメモリの消費が大きいらしいです。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;■SAX&lt;/b&gt;&lt;br /&gt;
SAXはXML文章を先頭から最後まで順番に読み込んでいき、タグを見つけるたびにメソッドが呼ばれる方式です。&lt;br /&gt;
&lt;br /&gt;
例えば以下のようなXMLがあった場合&lt;br /&gt;
&lt;br /&gt;
＜itemName＞PHP逆引きレシピ＜/itemName＞&lt;br /&gt;
＜catchcopy＞【送料無料】＜/catchcopy＞&lt;br /&gt;
＜itemCode＞book:13217617＜/itemCode＞&lt;br /&gt;
＜itemPrice＞2730＜/itemPrice＞&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
こんな感じになります&lt;br /&gt;
&lt;br /&gt;
〜SAXのイメージ〜&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;パーススタート&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;＜itemName＞　→　開始タグ発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;PHP逆引きレシピ　→　要素発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;＜/itemName＞　→　終了タグ発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;＜catchcopy＞　→　開始タグ発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;【送料無料】　→　要素発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;＜/catchcopy＞　→　終了タグ発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;＜itemCode＞　→　開始タグ発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;book:13217617　→　要素発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;＜/itemCode＞　→　終了タグ発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;＜itemPrice＞　→　開始タグ発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;2730　→　要素発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;＜/itemPrice＞　→　終了タグ発見メソッドが呼ばれる&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;↓&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;パース終了&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
とこんな感じで、XMLを先頭から最後まで一つひとつ見ていき、「タグ発見メソッド」「要素発見メソッド」「終了タグ発見メソッド」がアホほど呼ばれるのがSAXパーサーです。&lt;br /&gt;
&lt;br /&gt;
これはメモリの消費も少なく、高速らしいので、限られたリソース内で稼働させるアプリに関しては、SAXパーサーを使うのが良さそうです。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-size: x-large;&quot;&gt;２ SAXのフォーマット&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
それでは実装をする前にフォーマットを見てみましょう。&lt;br /&gt;
&lt;br /&gt;
まずはこんな感じでリクエストを作成します。NSString型の「requestUrl」がURLになります。以下のコードでリクエストを送信します。（今回はバーコード読み取り直後）&lt;br /&gt;
&lt;br /&gt;
//リクエストの送信方法&lt;br /&gt;
//----------------------------------------------------------------------------&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;NSString *requestUrl = @&quot;http〜〜〜〜〜〜〜〜〜&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;NSURL *url = [NSURL URLWithString:requestUrl]; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;[req addValue:@&quot;text/xml; charset=utf-8&quot; forHTTPHeaderField:@&quot;Content-Type&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;[req addValue:0 forHTTPHeaderField:@&quot;Content-Length&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;[req setHTTPMethod:@&quot;GET&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;conn = [[NSURLConnection alloc] initWithRequest:req delegate:self];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;color: blue; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if (conn)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;webData = [[NSMutableData data] retain];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
//----------------------------------------------------------------------------&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
そしたら以下の三つのメソッドを実装しましょう。それぞれ&lt;br /&gt;
「レスポンスを受信したとき」&lt;br /&gt;
「データを受け取ったとき」&lt;br /&gt;
「データの転送中にエラーがあったとき」&lt;br /&gt;
に呼ばれます。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
//レスポンスを受信したとき呼ばれるメソッド&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
//----------------------------------------------------------------------------&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void) connection:(NSURLConnection *) connection&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;didReceiveResponse:(NSURLResponse *) response&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[webData setLength: 0]; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
//データを受け取ったとき呼ばれるメソッド&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
//----------------------------------------------------------------------------&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void) connection:(NSURLConnection *) connection&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;didReceiveData:(NSData *) data&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[webData appendData:data];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
//データの転送中にエラーがあったとき&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
//----------------------------------------------------------------------------&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void) connection:(NSURLConnection *) connection&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; didFailWithError:(NSError *) error&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[webData release];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [connection release];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
そしてデータの受信がすべて完了したときに呼ばれるメソッドが以下の「connectionDidFinishLoading]です。&lt;br /&gt;
ここでXMLパーサーの実装をします。&lt;br /&gt;
&lt;br /&gt;
//データ受信終了後に呼ばれる（パースをここで開始する&lt;br /&gt;
//----------------------------------------------------------------------------&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void) connectionDidFinishLoading:(NSURLConnection *) connection&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [[NSURLCache sharedURLCache] setMemoryCapacity:0];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [[NSURLCache sharedURLCache] setDiskCapacity:0];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; xmlParser = [[NSXMLParser alloc] initWithData: webData];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [xmlParser setDelegate: self];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [xmlParser setShouldResolveExternalEntities:YES];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [xmlParser parse];&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [xmlParser release];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; ////////////////////////////&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //ここにパース終了後の記述（D）&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; ////////////////////////////&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
//パーサーがスタートタグを見つけたら呼び出される（A）&lt;br /&gt;
//----------------------------------------------------------------------------&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void) parser:(NSXMLParser *) parser&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;didStartElement:(NSString *) elementName&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; namespaceURI:(NSString *) namespaceURI&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;qualifiedName:(NSString *) qName&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;attributes:(NSDictionary *) attributeDict&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
//パーサーが要素のテキストを検出すると呼び出される（B）&lt;br /&gt;
//----------------------------------------------------------------------------&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void)parser:(NSXMLParser *) parser foundCharacters:(NSString *)string&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
//パーサーがエンドタグを見つけたら呼び出される（C）&lt;br /&gt;
//----------------------------------------------------------------------------&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void)parser:(NSXMLParser *)parser&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;didEndElement:(NSString *)elementName&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;namespaceURI:(NSString *)namespaceURI&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;qualifiedName:(NSString *)qName&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
上記のABC三つのメソッドはタグ、要素を見つけるたびに何度も呼ばれるメソッドです。&lt;br /&gt;
このABC内に取得したい情報を入手する内容を記述して、最後に(D)の部分でパース終了後の内容を記述します。全体的な流れはこんな感じです。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-size: x-large;&quot;&gt;２ 楽天APIからのXMLをパース&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
いざ実装開始です。前回まで使用してきたコードに書き加えます。&lt;br /&gt;
まずは、&lt;br /&gt;
今回使用するXMLパーサー　xmlParser&lt;br /&gt;
パースの最中にフラグの役割を果たす　elementkey&lt;br /&gt;
そのデリゲート　NSXMLParserDelegate&lt;br /&gt;
取得した情報を一時的に保管する　soapResultArray&lt;br /&gt;
最終的に取得した商品タイトルと商品画像URLを格納する　itemName、imageUrl&lt;br /&gt;
を宣言します。こんな感じ。&lt;br /&gt;
&lt;br /&gt;
//MonsterShowViewController.h&lt;br /&gt;
&lt;br /&gt;
//----------------------------------------------------------------------------&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@interface MonsterShowViewController : UIViewController ＜NSXMLParserDelegate＞&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; IBOutlet UIImageView *imageView;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; IBOutlet UILabel *itemNameLabel;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSString *jancode;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSMutableData *webData;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSURLConnection *conn;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSXMLParser *xmlParser;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; int elementkey;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSMutableArray *soapResultArray;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSString *itemName;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSString *imageUrl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@property(nonatomic,retain)UIImageView *imageView;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@property(nonatomic,retain)NSString *jancode;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@property(nonatomic,retain)UILabel *itemNameLabel;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void) parseTag:(NSString*)requestUrl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@end&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
//----------------------------------------------------------------------------&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
これで宣言はオーケー&lt;/div&gt;
&lt;div&gt;
次に実装です。先ほど示したフォーマットに、楽天のXMLから商品名と画像URLを取得するコードを書いていきます。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
まずは楽天へのリクエストURLをブラウザで直接見てみましょう。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU6HcqTucERbB1nE22PSLz_b39UHD7d0pLZfSdXydSRkp30sdbzz9bbfBaVUHHj2NMEihRTKV4egrZMJISo7ZhmVotPXqz4RYLrhS_6dARncr4qATIH12vPJlBshKyAuarAA8RQaAeLQo/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%25EF%25BC%25882011-07-17+16.31.51%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU6HcqTucERbB1nE22PSLz_b39UHD7d0pLZfSdXydSRkp30sdbzz9bbfBaVUHHj2NMEihRTKV4egrZMJISo7ZhmVotPXqz4RYLrhS_6dARncr4qATIH12vPJlBshKyAuarAA8RQaAeLQo/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%25EF%25BC%25882011-07-17+16.31.51%25EF%25BC%2589.png&quot; height=&quot;202&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
itemNameタグの中に商品タイトルが、&lt;/div&gt;
&lt;div&gt;
mediumImageUrlタグの中に、サムネイル画像へのリンクURLが&lt;/div&gt;
&lt;div&gt;
それぞれ入っていることがわかります。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
ここで注意点があります。要素を発見した際に呼ばれる「foundCharacters」メソッドですが、発見した要素によっては、数回にわかれて呼ばれることがあります。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
どういうことかと言いますと。例えば書籍タイトルが「PHP逆引きレシピ」だった場合には、「PHP」と「逆引きレシピ」にわかれて「foundCharacters」が呼ばれます。これを知らないと、なぜか取得したタイトルが「逆引きレシピ」だけになってしまうという自体に陥ります。僕はずっとこの謎が解けずに悩んでいた時期がありました。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
取得したタイトルを配列に保存することで、この問題は解決します。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
よって実装は以下のようにします。&lt;/div&gt;
&lt;div&gt;
始めに楽天にリクエストを投げる部分の処理は&lt;a href=&quot;http://dorokei.blogspot.com/2011/07/4apixml.html&quot;&gt;前回&lt;/a&gt;を見て下さい。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
//MonsterShowViewController.h&lt;br /&gt;
&lt;br /&gt;
//----------------------------------------------------------------------------&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void) connectionDidFinishLoading:(NSURLConnection *) connection&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [[NSURLCache sharedURLCache] setMemoryCapacity:0];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [[NSURLCache sharedURLCache] setDiskCapacity:0];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //パーサー生成&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; xmlParser = [[NSXMLParser alloc] initWithData: webData];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [xmlParser setDelegate: self];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [xmlParser setShouldResolveExternalEntities:YES];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; soapResultArray = [[NSMutableArray alloc]init];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; imageUrl = [[NSString alloc]init];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; itemName = [[NSString alloc]init];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //パース開始&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [xmlParser parse]; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [xmlParser release];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //ここにパース終了後の記述（D）&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //ラベルと画像を描画&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; itemNameLabel.text = itemName;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; imageView.image = [self getImage:imageUrl];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//パーサーがスタートタグを見つけたら呼び出される（A）&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//----------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void) parser:(NSXMLParser *) parser&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;didStartElement:(NSString *) elementName&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; namespaceURI:(NSString *) namespaceURI&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;qualifiedName:(NSString *) qName&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;attributes:(NSDictionary *) attributeDict&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //パーサーが開始タグ「itemName」「mediumImageUrl」を見つけたらフラグ「mediumImageUrl」を1に&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; if([elementName isEqualToString:@&quot;itemName&quot;] | [elementName isEqualToString:@&quot;mediumImageUrl&quot;])&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elementkey = 1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [soapResultArray removeAllObjects];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&quot;発見\n&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//パーサーが要素のテキストを検出すると呼び出される（B）&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//----------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void)parser:(NSXMLParser *) parser foundCharacters:(NSString *)string&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; if (elementkey == 1) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //開始タグを見つけた直後に要素を発見した場合、文字列を保管&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //要素によっては、このメソッドが数回呼ばれることがあるので、&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //配列に保管する。こうしないとタイトルが切れて保存されることも…&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [soapResultArray addObject:string];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//パーサーがエンドタグを見つけたら呼び出される（C）&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//----------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void)parser:(NSXMLParser *)parser&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;didEndElement:(NSString *)elementName&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;namespaceURI:(NSString *)namespaceURI&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;qualifiedName:(NSString *)qName&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //エンドタグ「itemName」を見つけ、文字列をitemNameに格納&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; if ([elementName isEqualToString:@&quot;itemName&quot;]) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NSString *str = @&quot;&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i&amp;lt;[soapResultArray count]; i++) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //配列に入ってる要素を文字列に直す処理&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; str = [NSString stringWithFormat:@&quot;%@%@&quot;,str, [soapResultArray objectAtIndex:i]];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NSLog(@&quot;取得した要素%@&quot;,str);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; itemName = str;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }else if ([elementName isEqualToString:@&quot;mediumImageUrl&quot;]){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //上記と同様。画像URlを取得&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NSString *str = @&quot;&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i&amp;lt;[soapResultArray count]; i++) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NSLog(@&quot;%d&quot;,[soapResultArray count]);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; str = [NSString stringWithFormat:@&quot;%@%@&quot;,str, [soapResultArray objectAtIndex:i]];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NSLog(@&quot;取得した要素%@&quot;,str);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; imageUrl = str;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; elementkey = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//NADataから画像を取得するメソッド&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;- (UIImage *)getImage:(NSString *)url {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; return [UIImage imageWithData:[self getData:url]];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//画像URLからNSDataを取得するメソッド&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;- (NSData *)getData:(NSString *)url {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSURLRequest *request = [NSURLRequest requestWithURL:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[NSURL URLWithString:[url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSURLResponse *response;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSError &amp;nbsp; &amp;nbsp; &amp;nbsp; *error;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSData *result = [NSURLConnection sendSynchronousRequest:request&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;returningResponse:&amp;amp;response error:&amp;amp;error];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; if (result == nil) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NSLog(@&quot;NSURLConnection error %@&quot;, error);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; return result;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@end&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
これでバーコド画像を撮影した後に、商品タイトルと画像が表示されるようになったと思います。&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1bO0sbQRSGdBDFHzLhfm2erHDT26kU4ekr2xAHXJnS1Q_8t5lcntk3HCkMUMOE6MXcqUmfyNel-LM_NZTRgxYyhGfcQN61twiyvHGbmiduPti9LdR3-jn5t3iMF7iS6ucXMKnKxeqKas/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%25EF%25BC%25882011-08-07+16.53.12%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1bO0sbQRSGdBDFHzLhfm2erHDT26kU4ekr2xAHXJnS1Q_8t5lcntk3HCkMUMOE6MXcqUmfyNel-LM_NZTRgxYyhGfcQN61twiyvHGbmiduPti9LdR3-jn5t3iMF7iS6ucXMKnKxeqKas/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%25EF%25BC%25882011-08-07+16.53.12%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;163&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/2482314342488430362/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2011/08/xmliphone.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/2482314342488430362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/2482314342488430362'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2011/08/xmliphone.html' title='XMLパーサーの実装編〜iPhoneバーコードリーダーアプリ制作第５回〜'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU6HcqTucERbB1nE22PSLz_b39UHD7d0pLZfSdXydSRkp30sdbzz9bbfBaVUHHj2NMEihRTKV4egrZMJISo7ZhmVotPXqz4RYLrhS_6dARncr4qATIH12vPJlBshKyAuarAA8RQaAeLQo/s72-c/%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%25EF%25BC%25882011-07-17+16.31.51%25EF%25BC%2589.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-5430409545588576969</id><published>2011-07-17T16:36:00.003+09:00</published><updated>2015-04-21T17:50:52.130+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iPhone"/><category scheme="http://www.blogger.com/atom/ns#" term="バーコドバトラーアプリ制作過程"/><title type='text'>バーコードバトラーiPhoneアプリ制作過程〜第4回楽天APIの利用、XMLパーサーとか〜</title><content type='html'>バーコードバトラーアプリ制作過程の第四回目です。（&lt;a href=&quot;http://dorokei.blogspot.com/2011/07/blog-post_11.html&quot;&gt;第三回はこちら&lt;/a&gt;）&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
１　楽天デベロッパーIDの取得&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
２　戦士情報画面の表示&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
３　リクエストURLの生成→XMLの取得&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
４　XMLパーサーの実装&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
５　結果（画像とテキスト）の表示&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
前回はバーコードリーダを実装して、バーコードからJANコードを取得するところまでやりました。今回はJANコードから商品情報を取得する部分まで実装します。&lt;br /&gt;
&lt;br /&gt;
どうやってJANコードから商品情報を取得するのか？&lt;br /&gt;
※JANコードってバーコードの下に書いてある数字のことね&lt;br /&gt;
&lt;br /&gt;
それはショッピングサイトのAPIを利用します。&lt;br /&gt;
楽天、ヤフー、アマゾン何でもいいのですが、ECサイトが提供している商品検索APIをもちいてJANコード検索を行います。&lt;br /&gt;
&lt;br /&gt;
では楽天、ヤフー、アマゾンどれを使うのが一番いいのでしょうか？&lt;br /&gt;
アマゾンは書籍がメインで、しかも商品マスタを持っており、ほぼすべての商品がJANコードを持っています。普通に考えたらアマゾンでしょう。&lt;br /&gt;
&lt;br /&gt;
が、しかしアマゾンAPIはアプリには利用できません。&lt;br /&gt;
規約により、&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;アマゾンAPIのモバイル端末での利用は、書面での許可なしでは利用してはいけないこと&lt;/span&gt;になっています。アマゾンに顧客を誘導するなどメリットを与えるなら別ですが、バーコードバトラーアプリでは全くもって論外ですね。&lt;br /&gt;
&lt;br /&gt;
ちなみにこの規約によって話題のアプリが消え去ったケースもあります。&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana, &#39;Lucida Sans Regular&#39;, &#39;Lucida Sans Unicode&#39;, Arial, sans-serif;&quot;&gt;&lt;a href=&quot;http://jp.techcrunch.com/archives/20090707amazon-killing-mobile-apps-that-use-its-data/&quot;&gt;Amazonが、同社のデータを使うモバイルアプリを抹殺しようとしている&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
じゃあヤフーか楽天ですね。&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;「jan」で検索して見ましょう&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;ヤフー：&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;約&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;&lt;span class=&quot;bo&quot;&gt;1,268,298&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;件&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;楽天　：&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 3px; -webkit-border-vertical-spacing: 3px; white-space: nowrap;&quot;&gt;全 5,243,555件&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
楽天のが多そうですね。とりあえず楽天のAPIを利用することにしましょう。一番いいのは、楽天で検索したあとに商品が見つからなかった場合のみ、再度ヤフー検索を実施するのがいいとは思うのですが、今回は楽天のみに絞ります。&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;１　楽天デベロッパーIDの取得&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
楽天のAPIの利用方法についてはここを参照して下さい。&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://webservice.rakuten.co.jp/api/itemsearch/#INDEX06&quot;&gt;楽天商品検索APIとは&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;デベロッパーIDが必要のようです。ここはなんの問題もないと思います。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;楽天に登録すればメールでデベロッパーIDを送信してくれます。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;早速リクエストURLを生成してみましょう。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;以下のURLの赤文字部分を自分自身のユーザーIDにして、ウェブブラウザで見てみましょう！&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;http://api.rakuten.co.jp/rws/3.0/rest?developerId=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;[あなたのdeveloperID]&lt;/span&gt;&amp;amp;operation=ItemSearch&amp;amp;version=2010-09-15&amp;amp;keyword=9784344016897&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;こんな感じでXMLが表示されればオーケーです。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSuCu5WTQuccl_EQheuTzq9oWgm0uqgXVphSl8D6va3sDF7aMBkV2uYOqmcAEDcK6GRxtESUKIe5ctf-fgaIFd47ctQJyjs8ybOUv3l2yaeGPEbNecKk8WS6poaYqZuwIcCHOGU0PBPaE/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%25EF%25BC%25882011-07-13+23.02.43%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSuCu5WTQuccl_EQheuTzq9oWgm0uqgXVphSl8D6va3sDF7aMBkV2uYOqmcAEDcK6GRxtESUKIe5ctf-fgaIFd47ctQJyjs8ybOUv3l2yaeGPEbNecKk8WS6poaYqZuwIcCHOGU0PBPaE/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%25EF%25BC%25882011-07-13+23.02.43%25EF%25BC%2589.png&quot; height=&quot;162&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-size: x-small; line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;このXMLのなかからタグ＜itemName＞と＜smallImageUrl＞の要素を取得します。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;本来検索キーワードを使用する場合、日本語をエンコードしたりしなければならないのですが、JANコードは半角数字なので、そのまま検索可能です！！これはらくちんでありがたいですな。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;２　戦士情報画面の表示&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
取得した商品（戦士）情報を表示するために、商品（戦士）表示画面を実装します。&lt;br /&gt;
編集画面とかで下からニュ〜って出てくるあの画面のことです。&lt;br /&gt;
&lt;br /&gt;
全体的な流れは以下の通り。&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
商品（戦士）表示画面にJANコードを渡す&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
↓&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
リクエストURLの生成&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
↓&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
xmlのパース&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
↓&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
商品情報表示&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
↓&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
戦闘力の算出（次回）&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
↓&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
戦士の端末への登録処理（次回以降）&lt;/div&gt;
&lt;br /&gt;
商品情報表示までを今回やります。&lt;br /&gt;
ではでは早速、商品（戦士）表示画面の実装を始めます。&lt;br /&gt;
&lt;br /&gt;
適当にUIViewControllerのサブクラスを作成して下さい。クラス名は適当にMonsterShowViewControllerとでもしましょうか。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://dorokei.blogspot.com/2011/07/blog-post_10.html&quot;&gt;前回&lt;/a&gt;の「&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;４つのtabに対するビューコントローラーを作成する」と全く一緒です。今回は折角ですのでXibファイルも一緒につくりましょう。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;File→New→New File→UIViewController subclassを選択→NEXTをクリック→UIViewControllerを選択してWith Xib〜チェックボックスにチェック→名前を&lt;/span&gt;MonsterShowViewControllerにして保存&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnv6I96BgxY0kuy5EkhgpP03CG5q-zWbr5PuwaFKgPU2tO7bz-0-Rt6lXox1UrYxBm8HbmuotAb40Qpe0Ky_gdgBauvO_RG0V8Hbjr1o4mNfawV-bBc2ryVOcMBSHfp0n-7_cWV6DcMXI/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%25EF%25BC%25882011-07-13+23.38.02%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnv6I96BgxY0kuy5EkhgpP03CG5q-zWbr5PuwaFKgPU2tO7bz-0-Rt6lXox1UrYxBm8HbmuotAb40Qpe0Ky_gdgBauvO_RG0V8Hbjr1o4mNfawV-bBc2ryVOcMBSHfp0n-7_cWV6DcMXI/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%25EF%25BC%25882011-07-13+23.38.02%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;165&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;こんな感じになればオーケー。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;次にMonsterShowViewController.xibファイルを編集します。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;まあこんな感じで、商品名表示用のlabelと、画像表示用のUIImageViewを貼付ければオーケー&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiSMJ6hyBi1RSm5aR5vFtZ0NiD_8pHagDf4Zo6XI7geNoQeVof_Kvlp4jivSKZ2db-9TedLGk6I00fLqy5_Yp08ZzOXadOarnEktrGdr1DPD7xdMFvtICEtFR9tIo1NRx8nb3nUv5J3A0/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%25EF%25BC%25882011-07-13+23.46.46%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiSMJ6hyBi1RSm5aR5vFtZ0NiD_8pHagDf4Zo6XI7geNoQeVof_Kvlp4jivSKZ2db-9TedLGk6I00fLqy5_Yp08ZzOXadOarnEktrGdr1DPD7xdMFvtICEtFR9tIo1NRx8nb3nUv5J3A0/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%25EF%25BC%25882011-07-13+23.46.46%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;218&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;MonsterShowViewController.xib&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;次に&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;MonsterShowViewController.hで使用する変数やらを宣言します。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;MonsterShowViewController.h&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;@interface MonsterShowViewController : UIViewController {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;IBOutlet UIImageView *imageView;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; IBOutlet UILabel *itemName;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; NSString *requestUrl;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; line-height: 18px;&quot;&gt;@property(nonatomic,retain)UIImageView *imageView;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; line-height: 18px;&quot;&gt;@property(nonatomic,retain)NSString *jancode;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; line-height: 18px;&quot;&gt;@property(nonatomic,retain)UILabel *itemName;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;@end&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;リクエスト用のURLも一緒に宣言しておきます。ちなみにIBOutletはInterfaceBuilderで使用してまっせという意味です。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;.mファイル側の@synthesizeも忘れずに。まあ注意出るから言わんでもわかると思うけど。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;MonsterShowViewController.h&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;#import &quot;MonsterShowViewController.h&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;@implementation MonsterShowViewController&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;@synthesize imageView;&lt;br /&gt;
@synthesize itemName;&lt;br /&gt;
@synthesize jancode;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (self) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Custom initialization&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return self;&lt;br /&gt;
}&lt;br /&gt;
---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
そしたら次にIB(InterfaceBuilder)を使用して、nibファイルとつなぎます。&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;MonsterShowViewController.xibを開いて、File&#39;s Ownerを右クリック。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;imageViewとImage View&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;itemNameとLavel&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;の二つを接続。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnMp4QE1QK37HhsgxCzclyQPXUn9zxOMcNfxjicHiU4-HiZMnseU1y1tr4oaDLROwoP7F5uA-jE9ZfW6_kR_N5-26n1qlLdtiqCWfWGW_LyKfS64u3IpIJaj6zKZTEHmn2aA-AzW9nFcA/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%25EF%25BC%25882011-07-14+23.06.48%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnMp4QE1QK37HhsgxCzclyQPXUn9zxOMcNfxjicHiU4-HiZMnseU1y1tr4oaDLROwoP7F5uA-jE9ZfW6_kR_N5-26n1qlLdtiqCWfWGW_LyKfS64u3IpIJaj6zKZTEHmn2aA-AzW9nFcA/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%25EF%25BC%25882011-07-14+23.06.48%25EF%25BC%2589.png&quot; height=&quot;274&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
↓&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVt_cNTPrcHHMozkZJcw0qKtXvX2XVA2deq-ngK7ePajqlDtNOdO9mKaBE3F0uD6QH2HGjw-tIRWxmb2AYYWLVYb8yYm9LGrfS6rT2-rNA6cmntGV5flwNLrHbi6j3q8KtzZuNqXm2qBQ/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%25EF%25BC%25882011-07-14+23.11.25%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVt_cNTPrcHHMozkZJcw0qKtXvX2XVA2deq-ngK7ePajqlDtNOdO9mKaBE3F0uD6QH2HGjw-tIRWxmb2AYYWLVYb8yYm9LGrfS6rT2-rNA6cmntGV5flwNLrHbi6j3q8KtzZuNqXm2qBQ/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%25EF%25BC%25882011-07-14+23.11.25%25EF%25BC%2589.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
これでオーケー！！&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
次にこのモンスター表示画面（戦士とか呼ぶよりモンスターのがしっくりきたので）をバーコード撮影後に呼び出します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
まず呼び出し側（BarcodeScanViewController）で呼び出される側（&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;MonsterShowViewController&lt;/span&gt;）のクラスをインポートします。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
そしたらBarcodeScanViewControllerの撮影完了後に呼び出されるメソッド内で、&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;MonsterShowViewControllerを呼び出してみましょう。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;以下のようにします。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal;&quot;&gt;BarcodeScanViewController.m （&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;didFinishPickingMediaWithInfoメソッド内）&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;- (void)imagePickerController:(UIImagePickerController *)reader&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;didFinishPickingMediaWithInfo:(NSDictionary *)info&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; id results = [info objectForKey:ZBarReaderControllerResults];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; ZBarSymbol *symbol = nil;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; for (symbol in results)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; [reader dismissModalViewControllerAnimated:YES];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; NSLog(@&quot;%@&quot;,symbol.data);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;MonsterShowViewController *monsterShow = [[MonsterShowViewController alloc]initWithNibName:@&quot;MonsterShowViewController&quot; bundle:nil];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; [self.view addSubview:monsterShow.view];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; [monsterShow release];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;これでバーコード撮影後に&lt;/span&gt;&lt;/span&gt;商品（モンスター）表示画面が表示されると思います。一応テストしてみて下さい。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;３　リクエストURLの生成→XMLの取得&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
リクエストURLを作成して、楽天からxmlを取得してみましょう。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
まず、モンスター表示クラス（&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;MonsterShowViewController）に取得したJANコードを渡します。&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal;&quot;&gt;BarcodeScanViewController.m の&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;didFinishPickingMediaWithInfoメソッド内に以下のコードを付け足します。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal;&quot;&gt;BarcodeScanViewController.m （&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;didFinishPickingMediaWithInfoメソッド内）&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;- (void)imagePickerController:(UIImagePickerController *)reader&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;didFinishPickingMediaWithInfo:(NSDictionary *)info&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; id results = [info objectForKey:ZBarReaderControllerResults];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; ZBarSymbol *symbol = nil;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; for (symbol in results)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; [reader dismissModalViewControllerAnimated:YES];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; NSLog(@&quot;%@&quot;,symbol.data);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; MonsterShowViewController *monsterShow = [[MonsterShowViewController alloc]initWithNibName:@&quot;MonsterShowViewController&quot; bundle:nil];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;monsterShow.jancode =&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;symbol.data;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; [self.view addSubview:monsterShow.view];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; [monsterShow release];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;これでオーケー。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;次に、取得したJANコードからURLを生成するメソッドを追加します。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: 17px;&quot;&gt;http://api.rakuten.co.jp/rws/3.0/rest?developerId=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;[あなたのdeveloperID]&lt;/span&gt;&amp;amp;operation=ItemSearch&amp;amp;version=2010-09-15&amp;amp;keyword=&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;の末尾にjanコードをつけ足せばいいだけですね。以下のようにします。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;MonsterShowViewController.m　&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;viewDidLoadメソッド&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;- (void)viewDidLoad&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; [super viewDidLoad];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; NSLog(@&quot;monsterShowに渡されたjancode %@&quot;,jancode);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; NSString *requestUrl;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; requestUrl = [@&quot;http://api.rakuten.co.jp/rws/3.0/rest?developerId=&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: 17px;&quot;&gt;[あなたのdeveloperID]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;amp;operation=ItemSearch&amp;amp;version=2010-09-15&amp;amp;keyword=&quot;stringByAppendingString:jancode];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;こんなんでオーケーなんですな。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;それではリクエストを投げてみましょう。ここからは面倒ですぜ兄さん。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;まず、ヘッダーファイル（&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;MonsterShowViewController.h）&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;で色々宣言しましょう。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;MonsterShowViewController.h&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;@interface MonsterShowViewController : UIViewController {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; IBOutlet UIImageView *imageView;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; IBOutlet UILabel *itemNameLabel;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; NSString *jancode;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;NSMutableData *webData;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; NSURLConnection *conn;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;@property(nonatomic,retain)UIImageView *imageView;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;@property(nonatomic,retain)NSString *jancode;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;@property(nonatomic,retain)UILabel *itemNameLabel;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;-(void) parseTag:(NSString*)requestUrl;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;@end&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;あたらしく二つのインスタンス変数と、一つのメソッドが宣言されました。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;次に実装です。&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;以下のコードをぐばっとコピー＆ペーストしちゃって下さい。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;MonsterShowViewController.m&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;-(void) parseTag:(NSString*)requestUrl;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; NSURL *url = [NSURL URLWithString:requestUrl]; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[req addValue:@&quot;text/xml; charset=utf-8&quot; forHTTPHeaderField:@&quot;Content-Type&quot;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[req addValue:0 forHTTPHeaderField:@&quot;Content-Length&quot;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[req setHTTPMethod:@&quot;GET&quot;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;conn = [[NSURLConnection alloc] initWithRequest:req delegate:self];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if (conn)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;webData = [[NSMutableData data] retain];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;-(void) connection:(NSURLConnection *) connection&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;didReceiveResponse:(NSURLResponse *) response&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[webData setLength: 0]; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;-(void) connection:(NSURLConnection *) connection&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;didReceiveData:(NSData *) data&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[webData appendData:data];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;-(void) connection:(NSURLConnection *) connection&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; didFailWithError:(NSError *) error&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; //伝送中にエラーが生じた場合&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[webData release];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; [connection release];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;-(void) connectionDidFinishLoading:(NSURLConnection *) connection&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; //接続が終了し、レスポンスのダウンロードに成功すると、次のconnectionDidFinishLoading:メソッドが呼び出される。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;NSString *theXML = [[NSString alloc] initWithBytes: [webData mutableBytes]&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;length:[webData length]&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;encoding:NSUTF8StringEncoding];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;//---shows the XML---&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;NSLog(@&quot;%@&quot;,theXML);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[theXML release]; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;んで、呼び出しはこんな感じ。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;MonsterShowViewController.m　&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;viewDidLoadメソッド&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;- (void)viewDidLoad&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; [super viewDidLoad];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; NSLog(@&quot;monsterShowに渡されたjancode %@&quot;,jancode);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; NSString *requestUrl;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; requestUrl = [@&quot;http://api.rakuten.co.jp/rws/3.0/rest?developerId=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: 17px;&quot;&gt;[あなたのdeveloperID]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&amp;amp;operation=ItemSearch&amp;amp;version=2010-09-15&amp;amp;keyword=&quot;stringByAppendingString:jancode];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;　[self parseTag:requestUrl];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;---------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;これで完了です。（あれ意外と一瞬で終わってもうたぞ）&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Hiragino Kaku Gothic Pro&#39;; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;早速実行してみましょう。&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;カメラでの撮影が終了すると、コンソール上にxmlの内容が大量に表示されるはずです。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU6HcqTucERbB1nE22PSLz_b39UHD7d0pLZfSdXydSRkp30sdbzz9bbfBaVUHHj2NMEihRTKV4egrZMJISo7ZhmVotPXqz4RYLrhS_6dARncr4qATIH12vPJlBshKyAuarAA8RQaAeLQo/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%25EF%25BC%25882011-07-17+16.31.51%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU6HcqTucERbB1nE22PSLz_b39UHD7d0pLZfSdXydSRkp30sdbzz9bbfBaVUHHj2NMEihRTKV4egrZMJISo7ZhmVotPXqz4RYLrhS_6dARncr4qATIH12vPJlBshKyAuarAA8RQaAeLQo/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%25EF%25BC%25882011-07-17+16.31.51%25EF%25BC%2589.png&quot; height=&quot;202&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;コンソールってどこー？？って人は、xcodeの右上にある&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYihXIEVDG7bV2wFHhnxsffpt-tkGP45sfDuyVXRneZU2VSYTqyxkzswwP87VVQWtk7LhMigcLwMbCSu2vaTWhnApyNvL3mBSwdJjNG6ld6H7dxVsZBfkg7mnte5ZRN2kGkTFIz89q1UY/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%25EF%25BC%25882011-07-17+16.33.05%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYihXIEVDG7bV2wFHhnxsffpt-tkGP45sfDuyVXRneZU2VSYTqyxkzswwP87VVQWtk7LhMigcLwMbCSu2vaTWhnApyNvL3mBSwdJjNG6ld6H7dxVsZBfkg7mnte5ZRN2kGkTFIz89q1UY/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%25EF%25BC%25882011-07-17+16.33.05%25EF%25BC%2589.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;の真ん中をクリックしてみて下さい。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;これでXML情報を取得するところまでは実装できました。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;当初の予定ではXML内容を解析するところまでやる予定だったのですが、字数がやたら多くなってしまったので、XMLの解析は次回にまわします。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;ではでは。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/5430409545588576969/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2011/07/4apixml.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/5430409545588576969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/5430409545588576969'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2011/07/4apixml.html' title='バーコードバトラーiPhoneアプリ制作過程〜第4回楽天APIの利用、XMLパーサーとか〜'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSuCu5WTQuccl_EQheuTzq9oWgm0uqgXVphSl8D6va3sDF7aMBkV2uYOqmcAEDcK6GRxtESUKIe5ctf-fgaIFd47ctQJyjs8ybOUv3l2yaeGPEbNecKk8WS6poaYqZuwIcCHOGU0PBPaE/s72-c/%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%25EF%25BC%25882011-07-13+23.02.43%25EF%25BC%2589.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-8856028173254057271</id><published>2011-07-11T00:16:00.004+09:00</published><updated>2015-04-21T17:52:04.346+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iPhone"/><category scheme="http://www.blogger.com/atom/ns#" term="バーコドバトラーアプリ制作過程"/><title type='text'>バーコードバトラーアプリ制作過程〜バーコードリーダー実装〜</title><content type='html'>バーコードバトラーアプリ制作過程三回目です。（&lt;a href=&quot;http://dorokei.blogspot.com/2011/07/blog-post_10.html&quot;&gt;第二回はこちら&lt;/a&gt;）&lt;br /&gt;
今回はバーコードリーダーを実装したいと思います。&lt;br /&gt;
&lt;br /&gt;
バーコードリーダーの実装には&lt;a href=&quot;http://zbar.sourceforge.net/iphone/index.html&quot;&gt;Zbar bar code reader&lt;/a&gt;を使用します。&lt;br /&gt;
以下のサイトを参考にしました。&lt;br /&gt;
&lt;a href=&quot;http://d.hatena.ne.jp/studiork/20101019/1287489283&quot;&gt;「ZBar SDK」を使ってみる　ーI Lib Keep&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ではでは始めましょう。全体的な流れは以下の通りです。&lt;br /&gt;
１　ZBarSDKダウンロード&lt;br /&gt;
２　ダウンロードしたSDKフォルダのプロジェクトへの追加&lt;br /&gt;
３　その他Frameworkのプロジェクトへの追加&lt;br /&gt;
４　スキャン処理の実装&lt;br /&gt;
５　シミュレータによるテスト&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;１　ZBarSDKダウンロード&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
まずは&lt;a href=&quot;http://zbar.sourceforge.net/iphone/index.html&quot;&gt;Zbar 公式サイト&lt;/a&gt;の「&lt;a href=&quot;http://sourceforge.net/projects/zbar/files/iPhoneSDK/ZBarSDK-1.1.dmg/download&quot;&gt;Download the ZBar iPhone SDK 1.1&lt;/a&gt;」よりZbarSDKをダウンロードします。以上！&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;２　ダウンロードしたSDKフォルダのプロジェクトへの追加&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
ダウンロードしたZBarSDK-1.1.dmgファイルを選択すると以下のウィンドウが表示されると思います。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAnS6BOnKcRgtuHwOMG6NQaJG9KL_Ad9MyAgON-L9hAmhuTQWEPCAzzO7nceLzz4YpP3feicIAYJ1k_MSMS2ocR5ucPKf9JL7gVjNdbeLfApFvyFpIhzvxh_rzK3g-McBvjidZKJcvwkQ/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%25EF%25BC%25882011-07-10+14.20.40%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAnS6BOnKcRgtuHwOMG6NQaJG9KL_Ad9MyAgON-L9hAmhuTQWEPCAzzO7nceLzz4YpP3feicIAYJ1k_MSMS2ocR5ucPKf9JL7gVjNdbeLfApFvyFpIhzvxh_rzK3g-McBvjidZKJcvwkQ/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%25EF%25BC%25882011-07-10+14.20.40%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;279&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
そしたら指示取りにZBarSDKフォルダをXcodeのプロジェクトにドラッグします。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOUjJ1wNgk675zASPtl-NdzQ6wVsMoDdAEh5JjMd4Yr2ZnsENPC2MBJJEzLD6cGg9TfuWIDJgw70lybmPoGxP1hQmQnwJLDRWMMuvjzNfedgSaF73gzb-zJpfw5pCM4idgghHdftFTHx4/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%25EF%25BC%25882011-07-10+14.26.23%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOUjJ1wNgk675zASPtl-NdzQ6wVsMoDdAEh5JjMd4Yr2ZnsENPC2MBJJEzLD6cGg9TfuWIDJgw70lybmPoGxP1hQmQnwJLDRWMMuvjzNfedgSaF73gzb-zJpfw5pCM4idgghHdftFTHx4/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%25EF%25BC%25882011-07-10+14.26.23%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;154&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
ここにぶち込みます&lt;/div&gt;
&lt;br /&gt;
そうすると以下のように聞かれますので、&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwsKGs5zcb-lx3jYrslsqUBkSWVLKuyW-13Ofad_z2hJAd6VztFtRl9UuTcp8eBx4oJHJcaQrxv3mnDAxQETtVNjBjXWj0ZOtfGVf-5tvTPq9HfavCg7UirbyOG5zrWWU3DTcWuPgf6fk/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%25EF%25BC%25882011-07-10+14.25.21%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwsKGs5zcb-lx3jYrslsqUBkSWVLKuyW-13Ofad_z2hJAd6VztFtRl9UuTcp8eBx4oJHJcaQrxv3mnDAxQETtVNjBjXWj0ZOtfGVf-5tvTPq9HfavCg7UirbyOG5zrWWU3DTcWuPgf6fk/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%25EF%25BC%25882011-07-10+14.25.21%25EF%25BC%2589.png&quot; height=&quot;213&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
グループフォルダにコピーをチェック&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
グループを作成にチェック&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
ダーゲットにCodeFighterを設定&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
してFinishを選択します。どーん！&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;３　その他Frameworkのプロジェクトへの追加&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
つぎに必要なFrameworkを追加します。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
■AVFoundation.framework (weak)&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
■CoreMedia.framework (weak)&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
■CoreVideo.framework (weak)&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
■QuartzCore.framework&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
■libiconv.dylib&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
この５つですね。Read this Firstにもこいつら入れろって書いてありますね。&lt;br /&gt;
&lt;br /&gt;
左のグループ内、一番上の青いアイコンCodeFighterをクリックします&lt;br /&gt;
次にTARGETS内のCodeFighterをクリックします。&lt;br /&gt;
んでBuilds Phasesを選択&lt;br /&gt;
Link Binary With Librariesを選択&lt;br /&gt;
ここでフレームワーク追加できます。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9BHVdNi82KrmXfaejR1cVccfsSHshyphenhyphenkv-4LACl5c9fNSDP1zGwcrRgz3Hs5qh-XI-3VduwlPPNad5eGMmUgI8mjLDYgyK-OLD9Dd8vGctQzJKF6GtlbBNghVD8dA4RMGW30Z-n-huFfE/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%25EF%25BC%25882011-07-10+14.36.53%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9BHVdNi82KrmXfaejR1cVccfsSHshyphenhyphenkv-4LACl5c9fNSDP1zGwcrRgz3Hs5qh-XI-3VduwlPPNad5eGMmUgI8mjLDYgyK-OLD9Dd8vGctQzJKF6GtlbBNghVD8dA4RMGW30Z-n-huFfE/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%25EF%25BC%25882011-07-10+14.36.53%25EF%25BC%2589.png&quot; height=&quot;141&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
ここにある＋をクリックすると追加できるフレームワークの一覧が表示されます。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigD2W9SL1WiWn43vbFYXqlIAg_Cg2u6Yp0EE9s9L_VDg5vWvlr8rLrXiNjZIVRT2qJTcqXbBbtV_GHRgVqcJIqlXipVwGqUSyefd3NeFfz4VcamldB14NC71QDFxfHhRkqBR3Gs92XS2k/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%25EF%25BC%25882011-07-10+14.38.08%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigD2W9SL1WiWn43vbFYXqlIAg_Cg2u6Yp0EE9s9L_VDg5vWvlr8rLrXiNjZIVRT2qJTcqXbBbtV_GHRgVqcJIqlXipVwGqUSyefd3NeFfz4VcamldB14NC71QDFxfHhRkqBR3Gs92XS2k/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%25EF%25BC%25882011-07-10+14.38.08%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;225&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
ここで先ほどの５つ&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
■AVFoundation.framework (weak)&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
■CoreMedia.framework (weak)&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
■CoreVideo.framework (weak)&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
■QuartzCore.framework&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
■libiconv.dylib&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
をバンバンaddしちゃってください。&lt;br /&gt;
&lt;br /&gt;
これでZbarを使用する準備が整いました。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;４　スキャン処理の実装&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
まずはBarcodeScanViewControllerにスキャン用のボタンを設置します。&lt;br /&gt;
前回ラベルを作成した部分、viewDidLoadメソッドにボタン設置のコードを書きます。&lt;br /&gt;
&lt;br /&gt;
BarcodeScanViewController.m&lt;br /&gt;
--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;- (void)viewDidLoad&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; [super viewDidLoad];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; UILabel *namelabel = [[UILabel alloc] init];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; namelabel.frame = CGRectMake(80, 10, 200, 50);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; namelabel.text = @&quot;僕はbarcodeScanViewControllerだよ&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; namelabel.textColor = [UIColor blueColor];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; namelabel.font = [UIFont fontWithName:@&quot;AppleGothic&quot; size:12];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; [self.view addSubview:namelabel];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
こうなっている部分を以下のように書き換えます。&lt;br /&gt;
前回記述したラベルの表示部分は消してしまいましょう。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
BarcodeScanViewController.m&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
--------------------------------------------------------------&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;- (void)viewDidLoad&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [super viewDidLoad];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; btn.frame = CGRectMake(10, 200, 300, 30);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [btn setTitle:@&quot;バーコードスキャン&quot; forState:UIControlStateNormal];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; // ボタンがタッチダウンされた時にscanButtonTappedメソッドを呼び出す&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [btn addTarget:self action:@selector(scanButtonTapped:)forControlEvents:UIControlEventTouchDown];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [self.view addSubview:btn];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
これでボタンを押したときに、scanButtonTappedメソッドが呼ばれることになります。&lt;br /&gt;
scanButtonTappedは自身で記述する必要があります。&lt;br /&gt;
記述する場所はどこでもかまわないのですが、viewDidLoadメソッドの真下にでも書いちゃいましょう。&lt;br /&gt;
&lt;br /&gt;
スキャンボタンが押されたときのアクションを以下のように記述します。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
BarcodeScanViewController.m&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
--------------------------------------------------------------&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void)scanButtonTapped:(UIButton*)button&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; UIAlertView *alert =[[UIAlertView alloc] initWithTitle:@&quot;確認&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;message:@&quot;スキャンボタンがタップされました&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delegate:self&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cancelButtonTitle:@&quot;確認&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;otherButtonTitles:nil];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [alert show];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
これでボタンが押されたときに、アラートが表示されるようになっていると思います。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyUClxQyHwx8kIEn7sqUhmz36UMhEwfnEi74_g8w_5HwKWDItRMAs_zYiwy9cFmcIft4ZokCtXwFXFQ9KwlM8IiM5ogI1h7UId24L1cHSJq8cMfytIWPofHr1aEDwnLWGeD_FNGkUFUHQ/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%25EF%25BC%25882011-07-10+23.16.52%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyUClxQyHwx8kIEn7sqUhmz36UMhEwfnEi74_g8w_5HwKWDItRMAs_zYiwy9cFmcIft4ZokCtXwFXFQ9KwlM8IiM5ogI1h7UId24L1cHSJq8cMfytIWPofHr1aEDwnLWGeD_FNGkUFUHQ/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%25EF%25BC%25882011-07-10+23.16.52%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;162&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
これでボタンが実装できました。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
それではいよいよ本題であるバーコード読み取り部分を実装してみましょう。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
なにをするのか？？&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;a href=&quot;http://d.hatena.ne.jp/studiork/20101019/1287489283&quot;&gt;「ZBar SDK」を使ってみる　ーI Lib Keep&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
に記載のあるコードをそのまま使っちゃいましょう！！&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
必殺コピペです！！&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
先ほどボタンがタップされたときに呼ばれるメソッド、scanButtonTappedでアラートが表示されるようにしましたが、ここを書き換えます。（そんなすぐ書き換えるなら始めからやれよって？？まあそうなんですけど…）&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
BarcodeScanViewController.m&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
--------------------------------------------------------------&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;-(void)scanButtonTapped:(UIButton*)button&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;ZBarReaderViewController *reader = [[ZBarReaderViewController alloc] init];&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; reader.readerDelegate = self;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; ZBarImageScanner *scanner = reader.scanner;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [scanner setSymbology:ZBAR_I25&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;config:ZBAR_CFG_ENABLE&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;to:0];&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [self presentModalViewController:reader&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; animated:YES];&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [reader release];&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
--------------------------------------------------------------&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
このように書き換えます。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
コピー＆ペースト素晴らしいですね！&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
しかしこいつを貼付けた直後に大量にエラーが表示されたと思います。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
なぜ？？&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
これはZbarを使えるようにimportしてないからなんですね。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
そういうわけで、ZBarSDK.hをインポートします。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
わざわざ説明するまでもないですが、こんな感じで。&lt;br /&gt;
&lt;br /&gt;
BarcodeScanViewController.h&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
--------------------------------------------------------------&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#import&amp;nbsp;&lt;uikit uikit.h=&quot;&quot;&gt;&lt;uikit uikit.h=&quot;&quot;&gt;&lt;/uikit&gt;&lt;/uikit&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#import &quot;ZBarSDK.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@interface BarcodeScanViewController : UIViewController&lt;zbarreaderdelegate&gt;&lt;/zbarreaderdelegate&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@end&lt;/span&gt;&lt;/div&gt;
--------------------------------------------------------------&lt;br /&gt;
※UIKitのインポートがなぜか消える…&lt;br /&gt;
&lt;br /&gt;
すると赤いエラーがつらつら消えます。気持ちいいですね。&lt;br /&gt;
と思いきやまだ&lt;br /&gt;
reader.readerDelegate = self;&lt;br /&gt;
あたりに黄色くエラーが出とります。&lt;br /&gt;
デリゲートがなんちゃら言うとりますね。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BarcodeScanViewController.h&lt;br /&gt;
--------------------------------------------------------------&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#importarSDK.h&quot;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@interface BarcodeScanViewController : UIViewController&lt;zbarreaderdelegate&gt;&lt;/zbarreaderdelegate&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;＜ZBarReaderDelegate＞&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@end&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#import &quot;ZB&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
--------------------------------------------------------------&lt;/div&gt;
※UIKitのインポートがなぜか消える…&lt;br /&gt;
※＜＞が大文字になっています。コピペの際はご注意を&lt;br /&gt;
&lt;br /&gt;
これで解決です。&lt;br /&gt;
これでカメラが起動してバーコードを勝手に取ってくれるカメラ機能の実装が完了しました。&lt;br /&gt;
次に、撮影が完了したあとのメソッドを実装します。&lt;br /&gt;
これも&lt;br /&gt;
&lt;a href=&quot;http://d.hatena.ne.jp/studiork/20101019/1287489283&quot;&gt;「ZBar SDK」を使ってみる　ーI Lib Keep&lt;/a&gt;&lt;br /&gt;
のコードをコピペしちゃいましょう。&lt;br /&gt;
結果表示の部分は先ほど使用したアラート表示を使用しています。&lt;br /&gt;
&lt;br /&gt;
またまた適当なところ（scanButtonTappedメソッドの真下あたりにでも）以下のコードをコピペします。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
BarcodeScanViewController.m&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
--------------------------------------------------------------&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;- (void)imagePickerController:(UIImagePickerController *)reader&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;didFinishPickingMediaWithInfo:(NSDictionary *)info&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; id results = [info objectForKey:ZBarReaderControllerResults];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; ZBarSymbol *symbol = nil;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; for (symbol in results)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; UIAlertView *alert =[[UIAlertView alloc] initWithTitle:@&quot;スキャン完了&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;message:symbol.data&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delegate:self&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cancelButtonTitle:@&quot;確認&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;otherButtonTitles:nil];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [alert show];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [reader dismissModalViewControllerAnimated:YES];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
スキャンの結果のJANコードがsymbol.dataで取れていることがわかりますね。&lt;br /&gt;
早速シミュレーターを起動してみましょう。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;５　シミュレータによるテスト&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
スキャンボタンを押してみると…&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCVdyjccglkugsrc2z-ZGPd15wBfH8tK3GF48Xu3G_YY6fD6voBXn3UzNEOvZODbhYPKuIIatS3ohutI7GaXkhdeR59-3G-Yl0J2rBdnJCqELL46NbJj1YAMcukzUE-t3Jy6xrzzxKyfI/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%25EF%25BC%25882011-07-10+23.59.51%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCVdyjccglkugsrc2z-ZGPd15wBfH8tK3GF48Xu3G_YY6fD6voBXn3UzNEOvZODbhYPKuIIatS3ohutI7GaXkhdeR59-3G-Yl0J2rBdnJCqELL46NbJj1YAMcukzUE-t3Jy6xrzzxKyfI/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%25EF%25BC%25882011-07-10+23.59.51%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;164&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
げげっなんじゃこりゃあ！！&lt;br /&gt;
となったと思います。&lt;br /&gt;
&lt;br /&gt;
大丈夫ミスってはおりませぬ。&lt;br /&gt;
&lt;br /&gt;
この画面になったらaltキーを押しながら画面を長押しして見て下さい。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVlhXHY7gE3RWbIDNoyT6D01BmDzoWrpTfrm4jS_6RSIJ1MExyuzinJUMAZc2LEEWzAr4L5UlKYSxzyfiQWDutyOY1XFlLACkToGRHs6IA5gDUo1Sr9jSBIBc3_8e6Or5CdRRPg5w5lN0/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%25EF%25BC%25882011-07-11+0.02.13%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVlhXHY7gE3RWbIDNoyT6D01BmDzoWrpTfrm4jS_6RSIJ1MExyuzinJUMAZc2LEEWzAr4L5UlKYSxzyfiQWDutyOY1XFlLACkToGRHs6IA5gDUo1Sr9jSBIBc3_8e6Or5CdRRPg5w5lN0/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%25EF%25BC%25882011-07-11+0.02.13%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;165&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
つぎのようにカメラロールから画像を選択する画面に切り替わったと思います。&lt;br /&gt;
もちろんシミュレータのカメラロールに画像なんて入っていませんね。&lt;br /&gt;
&lt;br /&gt;
次の画像をデスクトップにでも保存して起動中のシミュレーターにドラック＆ドロップして下さい。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUgpHetZbnjWBpkmCmfrdNPKun60XeFpSBfV-E76PlVFiaCazEX6MGPIagvtfMUrs7Oam0pTgVNpxIzyR9KrIEkPi2_zA8DRnVYUltuaxl8vFeEqq3hjw3fajlU0a0OmxekzySiO8F0Wg/s1600/%25E5%2586%2599%25E7%259C%259F+%25289%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUgpHetZbnjWBpkmCmfrdNPKun60XeFpSBfV-E76PlVFiaCazEX6MGPIagvtfMUrs7Oam0pTgVNpxIzyR9KrIEkPi2_zA8DRnVYUltuaxl8vFeEqq3hjw3fajlU0a0OmxekzySiO8F0Wg/s320/%25E5%2586%2599%25E7%259C%259F+%25289%2529.JPG&quot; height=&quot;320&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
そしたらブラウザが立ち上がりますので、画像を長押ししてください。保存するかどうか聞かれますので、ここで保存。これでシミュレーターに画像が保存されました。（一回でなぜか保存されない場合があるので、そのときは何度か挑戦してみてください）&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSNRZFVS5s_KHS0qLyE7CM-Wb77HV6VFpRnb6IzundDzwYN4mvbEGUe56S01ByhJhq5gLIMW9V8DHE_x-OHfETxcbns-G9U9Tg6DsPHyntBM_kKC7LjLQX29iniHc5WmafIq5zErkC3S8/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%25EF%25BC%25882011-07-11+0.07.52%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSNRZFVS5s_KHS0qLyE7CM-Wb77HV6VFpRnb6IzundDzwYN4mvbEGUe56S01ByhJhq5gLIMW9V8DHE_x-OHfETxcbns-G9U9Tg6DsPHyntBM_kKC7LjLQX29iniHc5WmafIq5zErkC3S8/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%25EF%25BC%25882011-07-11+0.07.52%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;166&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
そしたら再度CodeFighterアプリを起動して、スキャンボタンをタップして、alt+左クリック長押しでカメラロールを起動。保存したバーコードを選択してみてください。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpJ6gGrenKrOMVO3nXrDgE5i9QMY3nC5IEO2lRrkugXCo78L765DRD44wk0rvkxI-AaN26_IrzuOoy8-98aawsHVsb0q8JaH5B9HEsg2DSM5djEva_SkoZnM9gQNFMcHN8kUfkFUyIf48/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%25EF%25BC%25882011-07-11+0.10.22%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpJ6gGrenKrOMVO3nXrDgE5i9QMY3nC5IEO2lRrkugXCo78L765DRD44wk0rvkxI-AaN26_IrzuOoy8-98aawsHVsb0q8JaH5B9HEsg2DSM5djEva_SkoZnM9gQNFMcHN8kUfkFUyIf48/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%25EF%25BC%25882011-07-11+0.10.22%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;167&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
つぎのように表示されればオーケーです。&lt;br /&gt;
これでバーコードからJANコードを取得するところまで実装できました。&lt;br /&gt;
&lt;br /&gt;
感無量ですな。&lt;br /&gt;
&lt;br /&gt;
JANコードが取れるとそれだけで色々できることがあるので、いろいろと活用していただけたらと思います。&lt;br /&gt;
&lt;br /&gt;
すこしつかれたお。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://dorokei.blogspot.com/2011/07/4apixml.html&quot;&gt;続き「&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;バーコードバトラーアプリ制作過程〜第4回楽天APIの利用、XMLパーサーとか〜&lt;/span&gt;」&lt;/a&gt;&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo}
&lt;/style&gt;


&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d62c24}
&lt;/style&gt;</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/8856028173254057271/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2011/07/blog-post_11.html#comment-form' title='1 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/8856028173254057271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/8856028173254057271'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2011/07/blog-post_11.html' title='バーコードバトラーアプリ制作過程〜バーコードリーダー実装〜'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAnS6BOnKcRgtuHwOMG6NQaJG9KL_Ad9MyAgON-L9hAmhuTQWEPCAzzO7nceLzz4YpP3feicIAYJ1k_MSMS2ocR5ucPKf9JL7gVjNdbeLfApFvyFpIhzvxh_rzK3g-McBvjidZKJcvwkQ/s72-c/%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%25EF%25BC%25882011-07-10+14.20.40%25EF%25BC%2589.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-1940408724903205107</id><published>2011-07-10T01:45:00.003+09:00</published><updated>2015-04-21T17:53:42.624+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iPhone"/><category scheme="http://www.blogger.com/atom/ns#" term="バーコドバトラーアプリ制作過程"/><title type='text'>バーコードバトラーアプリ制作過程〜下地〜</title><content type='html'>第二回目です。（&lt;a href=&quot;http://dorokei.blogspot.com/2011/07/blog-post.html&quot;&gt;一回目はこちら&lt;/a&gt;）&lt;br /&gt;
&lt;br /&gt;
早速初めましょう。&lt;br /&gt;
今回はプロジェクトを作成し、tabによって４つの画面を切り替えられるようにするところまでを開発します。&lt;br /&gt;
&lt;br /&gt;
※プログラム歴4ヶ月目の素人が書いてますので、用語の使用方法とが間違っていることも多いと思いますので、間違いに気づいた方はコメントしていただけると嬉しいです。&lt;br /&gt;
&lt;br /&gt;
Xcode4をインストールとかは適当にググって調べて下さい。&lt;br /&gt;
iPhoneのデベロッパープログラムは入ってない人は、AppStoreで600円で買わなきゃ行けないみたいですね…&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;１　プロジェクトを作成&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
xcodeの新規プロジェクトでApplicationのViewBasedApplicationを選択します。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTmoKe0Fpj9X3YFTfrvpx1NlNlMiXuVmeMf2lYU72-Zfj6XGHDbLInr5IR_j0Pb2mnHO6w49RDdqtQmbOWCLwW6AnmMdNAhadGzL-4t30ni7i393SRViGqvmmkk1Thxhjg9ONBjEfHvQY/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%25EF%25BC%25882011-07-09+22.27.38%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTmoKe0Fpj9X3YFTfrvpx1NlNlMiXuVmeMf2lYU72-Zfj6XGHDbLInr5IR_j0Pb2mnHO6w49RDdqtQmbOWCLwW6AnmMdNAhadGzL-4t30ni7i393SRViGqvmmkk1Thxhjg9ONBjEfHvQY/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%25EF%25BC%25882011-07-09+22.27.38%25EF%25BC%2589.png&quot; height=&quot;211&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Pruductの名前は適当にCodeFighterと設定します。保存場所も好きなところに。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;２　どんなデザインにするか？&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
んでどんな全体像にするか書いてませんでしたね。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
今回はTabBarを使います。tabによって４つのビューを切り替えます&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
tab1…バーコードスキャン画面、スキャンボタンがあり、押すとカメラが起動します&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
tab2…登録戦士View画面、Tabelビューで登録戦士の閲覧削除ができます&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
tab3…戦闘画面、戦士を選択し、Bumpのように相手と乾杯の動作で戦闘開始&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
tab4…戦績や使い方などの「その他」を表示します&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
こんな感じで。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAzSQYChosoMSjdiD8BJ0F_k3OYPMOD1YqN02EkBc-oBTWYxbFZAxs86KqkGe6yZp9m6mW3FCZSyD3JzVWx2G0e0w4rBom8-ijAlbVYDg4mTYKCiD9g-zMfIdRVKV-_MT_EFNtWtKT7-c/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%25EF%25BC%25882011-07-09+23.16.19%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAzSQYChosoMSjdiD8BJ0F_k3OYPMOD1YqN02EkBc-oBTWYxbFZAxs86KqkGe6yZp9m6mW3FCZSyD3JzVWx2G0e0w4rBom8-ijAlbVYDg4mTYKCiD9g-zMfIdRVKV-_MT_EFNtWtKT7-c/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%25EF%25BC%25882011-07-09+23.16.19%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;223&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
↑tabバーってのはこんな感じで画面下のタブで画面を切り替えるヤツ&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;２　InterfaceBuilderファイルについて&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
僕はInterfaceBuilderは使ったり使わなかったりします。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
一画面にやたらボタンやらテキストビューやらごちゃごちゃする場合には使います。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
そうじゃないなら使いません。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
今回はあんまりつかう必要はなさそうですな。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;3　４つのtabに対するビューコントローラーを作成する。&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
まず、自動生成されている&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
CodeFighterViewController.h&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
CodeFighterViewController.m&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
CodeFighterViewController.xib&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
の三つを削除しちゃいましょう。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLcM9qg5vsEabd6X-JPt03pYvhfOjhBaKJdZRnh_VtKnHJdwjbg1CNJKBx_igbStjnoM6LBLlRctq78X29N4jZjXdgNggSNQNI42EBOvdfSQMTDAmg6a_jBOVOz1RFrCZtLmLIGhraFwY/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%25EF%25BC%25882011-07-09+23.01.22%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLcM9qg5vsEabd6X-JPt03pYvhfOjhBaKJdZRnh_VtKnHJdwjbg1CNJKBx_igbStjnoM6LBLlRctq78X29N4jZjXdgNggSNQNI42EBOvdfSQMTDAmg6a_jBOVOz1RFrCZtLmLIGhraFwY/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%25EF%25BC%25882011-07-09+23.01.22%25EF%25BC%2589.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
右クリック→削除。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
んで４つのTabに対応するクラスを作成します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
File→New→New File...&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
を選択。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDSE6BiASuV3y50eHmgLjUwf39uwrolotu-zLSra8emVIa4gI5ZDnFhahi1xO_ZgHiRE1Qzx9llBxDDnijO9Fhck5v-wgIfmDp1-DgD23KqIxekHpcJ0WrpgGCXCaVO8MJua6xQz-FlDg/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%25EF%25BC%25882011-07-09+23.30.49%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDSE6BiASuV3y50eHmgLjUwf39uwrolotu-zLSra8emVIa4gI5ZDnFhahi1xO_ZgHiRE1Qzx9llBxDDnijO9Fhck5v-wgIfmDp1-DgD23KqIxekHpcJ0WrpgGCXCaVO8MJua6xQz-FlDg/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%25EF%25BC%25882011-07-09+23.30.49%25EF%25BC%2589.png&quot; height=&quot;215&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
ここでUIViewController subclassを選択。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Nextを選択すると、次の画面で何のサブクラスにするか聞かれますので、とりあえずここではデフォルトのままのUIViewControllerを選択します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
またここでXIBファイルを使用するかどうかをチェックボックスで選択できますので、チェックを外しておきましょう。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
ファイル名はBarcodeScanViewControllerとします。すると&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
BarcodeScanViewController.h&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
BarcodeScanViewController.m&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
の宣言ファイルと実装ファイルが自動生成されます。これはTab1のバーコードスキャンする画面に相当します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
全く同じ手順で他のTab2〜3のViewControllerも作成しましょう。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
それぞれのファイル名は&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
tab2→ListViewController&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
tab3→BattleViewController&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
tab4→OtherViewController&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
としました。最終的に次の画像のようになっているとおもいます。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA9_OQdtzFSCQ0JgfZSYZtPShwwflpHxubTAOzquGedQbKU7cKJpQ_vNzCcB0yFne27yzSIRBDN1uiziJ131fkBfYncrzzLy2Y1XAVSYIqztGqAPSUpCp0wT2qTT1rtCH02VC932rDz-Y/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%25EF%25BC%25882011-07-09+23.43.52%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA9_OQdtzFSCQ0JgfZSYZtPShwwflpHxubTAOzquGedQbKU7cKJpQ_vNzCcB0yFne27yzSIRBDN1uiziJ131fkBfYncrzzLy2Y1XAVSYIqztGqAPSUpCp0wT2qTT1rtCH02VC932rDz-Y/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%25EF%25BC%25882011-07-09+23.43.52%25EF%25BC%2589.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;４　作成した４つのビューをタブによって切り替えられるようにする&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
こっから直接コードいじり始めます。まずはCodeFighterAppDelegate.hから。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
開いてみると以下のようになっていると思います。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
CodeFighterAppDelegate.h&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;#import &lt;uikit uikit.h=&quot;&quot;&gt;&lt;/uikit&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;@class CodeFighterViewController;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;@interface CodeFighterAppDelegate : NSObject &lt;uiapplicationdelegate&gt; {&lt;/uiapplicationdelegate&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;@property (nonatomic, retain) IBOutlet UIWindow *window;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;@property (nonatomic, retain) IBOutlet CodeFighterViewController *viewController;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;@end&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
これを以下のように書き換えます。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
CodeFighterAppDelegate.h&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#import &lt;uikit uikit.h=&quot;&quot;&gt;&lt;/uikit&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@interface CodeFighterAppDelegate : NSObject &lt;uiapplicationdelegate&gt; {&lt;/uiapplicationdelegate&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@property (nonatomic, retain)&amp;nbsp;IBOutlet UIWindow *window;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@property (nonatomic, retain)&amp;nbsp;IBOutlet &amp;nbsp;UITabBarController *tabBarController;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;--------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
次にCodeFighterAppDelegate.m&lt;/div&gt;
&lt;div&gt;
最初はこんな感じになっていると思います。&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
CodeFighterAppDelegate.m&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;#import &quot;CodeFighterAppDelegate.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;#import &quot;CodeFighterViewController.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;@implementation CodeFighterAppDelegate&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;@synthesize window=_window;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;@synthesize viewController=_viewController;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; // Override point for customization after application launch.&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; self.window.rootViewController = self.viewController;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; [self.window makeKeyAndVisible];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; return YES;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
こんな感じに書き換えます&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
CodeFighterAppDelegate.m&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#import &quot;CodeFighterAppDelegate.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#import &quot;BarcodeScanViewController.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#import &quot;ListShowViewController.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#import &quot;BattleViewController.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#import &quot;OtherViewController.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@implementation CodeFighterAppDelegate&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@synthesize window=_window;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@synthesize tabBarController=_tabbarController;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none; color: blue;&quot;&gt;
&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none; color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none; color: blue;&quot;&gt;
&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none; color: blue;&quot;&gt;- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none; color: blue;&quot;&gt;
&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none; color: blue;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //ビュー１の設定&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; BarcodeScanViewController *tag1 = [[[BarcodeScanViewController alloc]init]autorelease];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; tag1.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearch tag:0]autorelease];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //ビュー2の設定&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; ListShowViewController *tag2 = [[[ListShowViewController alloc]init]autorelease];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; tag2.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearch tag:0]autorelease];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //ビュー3の設定&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; BattleViewController *tag3 = [[[BattleViewController alloc]init]autorelease];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; tag3.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearch tag:0]autorelease];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //ビュー4の設定&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; OtherViewController *tag4 = [[[OtherViewController alloc]init]autorelease];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; tag4.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearch tag:0]autorelease];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; NSArray *controllers = [NSArray arrayWithObjects:tag1,tag2,tag3,tag4, nil];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [(UITabBarController*)self.tabBarController setViewControllers:controllers animated:NO];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; self.window.rootViewController = self.tabBarController;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [self.window makeKeyAndVisible];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; return YES;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
つぎにMainWindow.xibを変更します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
Code Fighter View Controllerを削除し、Tab Bar Controllerを追加します。&lt;/div&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
そしてCodeFighter App DelegateのOutletsのtabBarControllerを追加した&lt;/div&gt;
&lt;/span&gt;Tab Bar Controllerと繋げます。以下のようになってればオーケーです。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwrfvs7B0hylsHIB0RE3qanOB_Btvt4CIMBuZL56pXPJr4kOIfOtVNVyqTMmzCDvib8FtVODucS-bZmSuzrylRPctK-63gW9G08F-bGvoDN9bUQKpZulL-HYlQbNaJfdgFBvHjPfN3Uu8/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%25EF%25BC%25882011-07-10+1.07.28%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwrfvs7B0hylsHIB0RE3qanOB_Btvt4CIMBuZL56pXPJr4kOIfOtVNVyqTMmzCDvib8FtVODucS-bZmSuzrylRPctK-63gW9G08F-bGvoDN9bUQKpZulL-HYlQbNaJfdgFBvHjPfN3Uu8/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%25EF%25BC%25882011-07-10+1.07.28%25EF%25BC%2589.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Tab Bar Controller追加後&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiemJIxD5el4fbByfaVFqzi8pLyQvDqUMTzam5j74p4JuXEtuNU31gwizP_FEDC-0SGbzGa-gTuTCtRg8uvDISMa5uDpwtYjlgX2NV0K-SBDf9JlaoCHPJcSY7RhO-Fur8YTzpSrqz4q8/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%25EF%25BC%25882011-07-10+1.01.53%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiemJIxD5el4fbByfaVFqzi8pLyQvDqUMTzam5j74p4JuXEtuNU31gwizP_FEDC-0SGbzGa-gTuTCtRg8uvDISMa5uDpwtYjlgX2NV0K-SBDf9JlaoCHPJcSY7RhO-Fur8YTzpSrqz4q8/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%25EF%25BC%25882011-07-10+1.01.53%25EF%25BC%2589.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;
&lt;/span&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Tab Bar Controllerと&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;tabBarController接続後&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;
&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;ここでいったんシミュレーターを起動してみましょう。&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;
&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;以下のようにタブが表示されればオーケーです。&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;
&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvuQ64ZSwEX18UXgOC9JLRK2ano-y1mvG_IgtNDyvDnLKC_of_ukK9lqPHCQC9lo72CzINlHZBBJfkI4yru1WKtlQO6ovVvLT4vhNUxz7m_AKqLu_oBVsny85IEJ_wIxZOjQx7QWx5arc/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%25EF%25BC%25882011-07-10+1.10.54%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvuQ64ZSwEX18UXgOC9JLRK2ano-y1mvG_IgtNDyvDnLKC_of_ukK9lqPHCQC9lo72CzINlHZBBJfkI4yru1WKtlQO6ovVvLT4vhNUxz7m_AKqLu_oBVsny85IEJ_wIxZOjQx7QWx5arc/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%25EF%25BC%25882011-07-10+1.10.54%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;165&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
しかしこれではビューが切り替わっているのかどうかわかりませんね。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;５　各ViewControllerにラベルを追加する&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
ビューが切り替わっていることを確認するために、各ViewControllerにラベルを追加します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
BarcodeScanViewController&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
ListViewController&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
BattleViewController&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
OtherViewController&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
の４つそれぞれの実装ファイル（.mファイル）に、コメントアウトされて緑色になっている以下のようなコードが見つかると思います。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
４つのViewController.m&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;/*&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;- (void)viewDidLoad&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; [super viewDidLoad];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;*/&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
viewDidLoadメソッドは文字通りViewがロードされた直後に呼ばれるメソッドです。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
ここで、それぞれのビューが呼ばれたことを示す文字列を表示するようにしたいと思います。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
以下のように書き換えます。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
４つのViewController.m&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;- (void)viewDidLoad&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [super viewDidLoad];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; UILabel *namelabel = [[UILabel alloc] init];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; namelabel.frame = CGRectMake(80, 10, 200, 50);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; namelabel.text = @&quot;僕はotherViewControllerだよ&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; namelabel.textColor = [UIColor blueColor];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; namelabel.font = [UIFont fontWithName:@&quot;AppleGothic&quot; size:12];&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; [self.view addSubview:namelabel];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
--------------------------------------------------------------------&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
namelabel.text = @&quot;僕はotherViewControllerだよ&quot;;&lt;/div&gt;
&lt;/span&gt;の「僕はotherViewControllerだよ」の部分は好きに変更して下さい。&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
次のようにビューが切り替わっているのが確認できると思います。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAmSlWmr_0j0TxBYr4tSI7m_sFlhgtCT4fCWxTmQNts3T4ieC5dTTChHHaZP0YDS82SXIZHHZhyUc9OBNohuPSdcoFAZ2fnwCp0nVp1ONP5d_M0oh2IlCbIwWcs1rSfHRCsvJIl8B5SwM/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%25EF%25BC%25882011-07-10+1.40.29%25EF%25BC%2589.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAmSlWmr_0j0TxBYr4tSI7m_sFlhgtCT4fCWxTmQNts3T4ieC5dTTChHHaZP0YDS82SXIZHHZhyUc9OBNohuPSdcoFAZ2fnwCp0nVp1ONP5d_M0oh2IlCbIwWcs1rSfHRCsvJIl8B5SwM/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%25EF%25BC%25882011-07-10+1.40.29%25EF%25BC%2589.png&quot; height=&quot;320&quot; width=&quot;164&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
これでタブバーによる画面の切り替えができるようになりました。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
次回からは各ビューの中身をいじっていきたいと思います。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
ちなみに次回はバーコード読み取り部分を実装します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
〜所感〜&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
これだけのことを書くのに二時間近くかかりました。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;&quot;&gt;
結構大変なんですな。&lt;/div&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.blogger.com/goog_1495260416&quot;&gt;続き「&lt;/a&gt;&lt;/span&gt;&lt;a href=&quot;http://dorokei.blogspot.com/2011/07/blog-post_11.html&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; line-height: 18px;&quot;&gt;バーコードバトラーアプリ制作過程〜バーコードリーダー実装〜&lt;/span&gt;」&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/1940408724903205107/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2011/07/blog-post_10.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/1940408724903205107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/1940408724903205107'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2011/07/blog-post_10.html' title='バーコードバトラーアプリ制作過程〜下地〜'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTmoKe0Fpj9X3YFTfrvpx1NlNlMiXuVmeMf2lYU72-Zfj6XGHDbLInr5IR_j0Pb2mnHO6w49RDdqtQmbOWCLwW6AnmMdNAhadGzL-4t30ni7i393SRViGqvmmkk1Thxhjg9ONBjEfHvQY/s72-c/%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%25EF%25BC%25882011-07-09+22.27.38%25EF%25BC%2589.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3054030883034606642.post-910162725628364433</id><published>2011-07-09T22:23:00.002+09:00</published><updated>2015-04-21T17:54:07.372+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iPhone"/><category scheme="http://www.blogger.com/atom/ns#" term="バーコドバトラーアプリ制作過程"/><title type='text'>バーコドバトラーアプリ制作過程〜序章〜</title><content type='html'>バーコードバトラーアプリを作ろうかと思う。&lt;br /&gt;
&lt;br /&gt;
バーコードを読み取ると戦士が誕生して、スマホに登録し、相手と通信対戦を行う。&lt;br /&gt;
小さい頃流行ったあのおもちゃをスマホアプリでやろうと言う訳です。&lt;br /&gt;
&lt;br /&gt;
実装しなければ行けない機能は以下の通り。&lt;br /&gt;
１　スマホのカメラ機能でバーコードを撮影し、JANコードを読み取る&lt;br /&gt;
２　ショッピングサイトのJANコード検索APIで商品名を取得&lt;br /&gt;
３　戦士のHPや攻撃力などのパラメーターを設定&lt;br /&gt;
４　SQLiteを使って戦士をアプリの保存、TableViewで閲覧、削除機能&lt;br /&gt;
５　iPhone同士の通信機能（バトル部分）&lt;br /&gt;
&lt;br /&gt;
大体こんな感じ。&lt;br /&gt;
バーコードリーダーは、iPhone、Androidともに作ったことがあるし、TableViewとCoreDataの部分もやったことはあるからいける。&lt;br /&gt;
&lt;br /&gt;
通信の所と、戦闘イベントの部分が未知数だけどまあなんとかなるでしょう。&lt;br /&gt;
&lt;br /&gt;
正直スクリーンショットとって丁寧に制作過程を記録するのは、それだけでかなり面倒なんで、だいたいこんな感じでやってますくらいにしか載せられない。&lt;br /&gt;
&lt;br /&gt;
さらに自分は4月から会社でアプリ制作を始めて、そのまえは全然プログラム未経験者なので相当わけがわかっていない記述も多くなると思う。&lt;br /&gt;
&lt;br /&gt;
まあ怠惰な自分への戒めと、制作過程の記録としてこの連載を書こうと思う。&lt;br /&gt;
&lt;br /&gt;
あんまり技術的なためにはならないとおもわれます…&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://dorokei.blogspot.com/2011/07/blog-post_10.html&quot;&gt;連載二回め「&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif; line-height: 18px;&quot;&gt;&lt;b&gt;バーコードバトラーアプリ制作過程〜下地〜&amp;nbsp;&lt;/b&gt;&lt;/span&gt;」&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://dorokei.blogspot.com/feeds/910162725628364433/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://dorokei.blogspot.com/2011/07/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/910162725628364433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3054030883034606642/posts/default/910162725628364433'/><link rel='alternate' type='text/html' href='http://dorokei.blogspot.com/2011/07/blog-post.html' title='バーコドバトラーアプリ制作過程〜序章〜'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>