「YMCK Player」やっとリリースできました。いろいろ良い評価もいただいております。
iOS4だと、"オートメーション" を編集した後メイン画面に戻れないという。

事前に何人かの人にテストしてもらっていたのだけど、誰も "編集" の画面には行ってなかったわけです・・・。

My App "YMCK Player" just has been released, and lots of friends reports their good experience.
But there also reports of the big bug...
On iOS4, after editing "Automation" you cannot back to the Main Screen.

I had send several copies to my friends for testing, but it revealed that nobody of them had never pushed "edit" button to edit Automation...
I have to think of better method of testing, like listing up the states that I have to check in advance etc.



まず Cocos2d 0.99 にアップグレードした理由について、この前のエントリでは "それくらいしかやること思いつかないから"、と書いたのだけど、実はその前にクラッシュログを読んで Cocos2d 関連のメッセージ呼び出しの後にクラッシュしているというところは突き止めてたんであります。
でも、そんなハッキリした問題があるとしたら、僕の周りの人の持っている OS も デバイス世代も違う iPhone達で皆動いている事実が説明できない。


cocos2d 0.8 以前をベースに構築した方は、こんな風にバージョンアップの時に引っかかる可能性があるので、早めに 0.9系にアップグレードしておいた方がいいかもしれませんよ・・・。

Invalid Binary

I've uploaded my binary to iTunes Connect, but I checked the status on the iTC page afterwards it turned to "Invalid Binary".
I've searched for the reason for an hour to have found that
I assigned a value to Code Signing Entitlement in the build settings by mistake.

When making ad-hoc build you have to set the string value "dist.plist" to Code Signing Entitlement. It has to be applied only to ad-hoc configuration, but I forgot to change the configuration selection pulldown on the top of Build Settings window and other configurations(Release/Debug) were changed without notice.

One more important thing here is, that you have to check the status of your app on the iTunes Connect page after you have uploaded the binary. Even when the upload was successful, this kind of thing may happen afterwards.
This time, if I didn't go check it, I'd have gotten an extra delay to the review.

iTunes Connect にバイナリをアップロードしたのだけど、後でステータスをチェックしてみると "Invalid Binary" になっていた。
1時間ほどかけて原因を探ってみると、「コード署名権限(Code Signing Entitlement)」に値が設定されてたのが問題だった。

やったことのある方はご存じと思うが ad-hoc バイナリを作るときには、コード署名権限のところに "dist.plist" を設定しなければいけない。これは ad-hoc構成にだけ行われるべきなのだけど、うっかりビルド設定の上の方にある構成選択ポップアップの選択を忘れていて、他の構成(Release/Debug)の方にも反映されてしまっていたのであります。

ここでもう一つ重要なのが、アップロードした後に iTunes Connect のページに行ってステータスを確認すべきということ。

Migrating to cocos2d 0.99

cocos2d 0.99.4 を導入してそれをベースにプロジェクト全体を構築し直したんですが、まぁわりと大仕事でした;

それはさておき、移行自体はだいたいcocos2dクラス名の頭に "CC" を付ければ良い。
AtlasSprite と AtlasAnimation だけはちょっと複雑だったけど、公式ドキュメントがかなり詳しくフォローしてくれてたので2時間強でなんとか移行完了(たぶん)。

It was a bit tough work to rebuild the project for newly installed cocos2d 0.99.4.
I believe it's unnecessary to do this, but I cannot think of any other possibility of having caused the crash in Apple's review.

Anyway, in migrating, most of the part is OK with adding "CC" to the cocos2d class names.
Only AtlasSprite and AtlasAnimation are a bit complex, but this official document is perfect and I was (seemingly) able to finish migrating in a couple of hours or so.

App still crashes?

コードを完全iOS4ベースにしまして、いくつかのデバイスで動作確認できたんですが、まだ Apple側が "iOS4でクラッシュしますぜ" と言ってくる。

I revised my code to full-iOS4 based and made sure it's working on several devices.
But Apple still reports that it crashes on iOS4.
If I had tested only on my single device there still might be possibility of compatibility problem, but I have tested on different generations of device and different versions on OS so I believe it's not the problem of the code itself.
The only difference between the test build and the submission build is code signing, but it didn't caused any problem in previous reviews.
I'm completely at a loss.

Scene transision doesn't work on iOS4?

前のポストにも書いた通り、iPhoneOS3.x 系のappを iOS4 対応するのは、まずビルドを通すのにすったもんだあるわけですが、さらにビルド通ったあともいろいろあったり。

これは cocos2d 0.7.x の話なんだけど 0.8.2 でもおおよそ同じ。

split = [(IntervalAction*)[actions objectAtIndex:0] duration] / duration;

As I said in my last two posts, Building iPhoneOS3.x-based app on iOS4 SDK causes lots of troubles, and now I've got another trouble even after the build's got a pass.

It seems to be working well at a first glance, but when a scene make a transition it ignores my code to let it slide in.

I searched around a bit and found this:
This is a cocos2d 0.7.x issue but it goes about the same on cocos2d 0.8.2, too.
I only modified single line at 162 and worked fine.

split = [(IntervalAction*)[actions objectAtIndex:0] duration] / duration;

iPhoneOS Deployment Target

I knew that to let the iOS4-based binary work on iPhoneOS3.x just open the Build Settings to set "Base SDK" to iPhone Device 4.0 and "iPhoneOS Deployment Target" to iPhoneOS3.x.
But I was a bit confused because "iPhoneOS Deployment Target" cell doesn't appear unless you set Base SDK to iPhone Device 4.0 beforehand.
It almost gave me a heart attack because my deadline was about to come.

iOS4 SDKでビルドしたものをiPhoneOS3.xで動くようにするには
"ベースSDK" をiPhone Device 4.0 にして "iPhoneOS Deployment Target" を iPhoneOS3.x にすればいい、ということなのだけど、ちょっと戸惑ったのが、ビルド設定画面で まず先にベースSDKを iPhone Device 4.0 に設定してからでないと、iPhoneOS Deployment Target の項目自体が出て来ないという点。

Upgrading SDK (continued)

iOS4 SDK でビルドが通らない理由は2つあった模様。
1) オブジェクト名が iOS4 で新たに導入された API とかぶっていた
2) cocos2d libraries のビルドターゲット設定を変えるのを忘れていた

理由 1) は細かく言うと2つあって、
一つは単純で、 AVPlayer という名前を普通の変数として使っていたというもの。これは納得。
もう一つはなんか不可解で、セレクタの名前に "player" というものを使っていて、これが何か悪さした風。

I've found there were two reasons of build failure on iOS4 SDK.
1) Object name conflicts with newly introduced iOS API
2) Forgot to change the Target Setting of Cocos2d Libraries

Reason 1) had two sub-reasons:
One is pretty simple, I was using the name "AVPlayer" as a variable. This is reasonable and I can understand.
The other is pretty incomprehensible, I used the name "player" as a selector, which seems to have caused some confusion.
How can a single selector name cause such confusion???
Fix the name to other one and succeeded to build, anyway...

Upgrading SDK

Build fails since I've upgraded SDK to iOS4 SDK.
Resetting Base SDK to iPhoneOS 3.2 in the Build Setting it worked well as before, so I guess there are some conflict with new API in iOS4.
I want to see what's wrong from the error messages, but what it says is too indirect to understand....

iOS4 SDKにしたらビルド通らなくなった・・・
ビルド設定でベースSDKを iPhoneOS 3.2 に戻したら動いたので、やはり iOS4 の新しい API との兼ね合いか!?

Get number of fingers touching

[[event allTouches] count]

[touches allObjects]

I didn't know that I can get the number of fingers that are currently touching by doing this:
[[event allTouches] count]

I only knew this
[touches allObjects]
which retrieves only the touches that triggered the event.