Xin is a graphic designer, web developer and iPhone programmer based in Shanghai, China. He's running SHINRA-CORE studio committed to create games and apps for iPhone.
- Adium
- Anime
- Apple
- App Store
- Beginning
- Beta
- Code
- Code Geass
- Cydia
- Design
- Example
- FAQ
- Games
- Gomoku
- Hangzhou
- Interface Builder
- iPhone
- iPhone Developer Program
- Jabber
- Java
- Live
- Nonsense
- NSString
- Performance
- Smack
- SQLite
- Themes
- Thinking
- Trip
- Tutorial
- UIActionSheet
- UIImageView
- UITableView
- UITableViewCell
- UIView
- UIViewController
- V2EX
- Video
- WordPress
- Xcode
- XMPP
iPhone OS 2.2 is a really big update, not only about features, but mostly about performance and stability.
From my real usage, Safari does crash less. Before 2.2, the most unstable web app is Google Reader, it can crash at any time, since I use Google Reader a lot on iPhone, what a pain it was. Now things are much better. And all components has dependency on WebKit also got enhancements, like UITableView, if you have some UIImageView inside UITableViewCell, you’ll find it scrolls much more smoother on 2.2! So, iPhone OS 2.2 is strongly recommended for everyone from newbies to developers.
On feature side, the new Emoji feature is particularly interesting, though it meant to be Japanese users only, but you can turn it on easily with some small helper program in Cydia installer. I really wish the cuteness be part of the whole world, not only Japan.
These days I’ve been working on an easy solution for implementing full text search on iPhone, and finally I got it working.
There is UISearchBar in UIKit, but there isn’t anything easy in iPhone SDK to help you implementing a high performance data structure for indexing and searching. After some Google search, I found that SQLite has a very promising full text search component called FTS3, however, this component exists in SQLite code tree as a plug-in, so it’s not to be found in iPhone’s built-in SQLite support.
To integrate FTS3 plug-in into your iPhone app, you need to build your own SQLite. Fortunately there is a project named The SQLite Amalgamation, it makes the whole SQLite source tree into three files: two .h headers and one .c source file. So you can create a group in your project in Xcode named SQLite, and drag-n-copy these 3 files into this group. So you’re ready to compile your own SQLite for your iPhone app.
Next step is to turn on FTS3 in sqlite3.c, you need to add this line:
#define SQLITE_ENABLE_FTS3 1
Below this line:
#define SQLITE_AMALGAMATION 1
Be aware that sqlite3.c is a very huge file weighing 340K+, it may crash your Xcode. You may want to open it in vim.
Now you can click build and play with your own SQLite 3 with FTS3. For more information on how to use FTS3, please read the official documentation, it’s quite easy:
Finally got the contract set up with Apple. So my little app appears to be “Ready for Sale” in iTunes Connect, but when I go to search it in App Store, no result matched.
It seems a lot developers are experiencing the same problem here:
http://discussions.apple.com/thread.jspa?threadID=1607276&tstart=60
Is this related to a slow updating rate of search index of iTunes Store? I can’t get my app showing up in iTunes Link Maker either.
But it’s possible to reach the app detail page in iTunes via direct link:
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=294454696
You can make your own direct link if you’re experiencing the same problem that app not showing up in search or link maker, just replace the id part in URL with your own app id, you can get it in app details in iTunes Connect.
IMHO, it does take too long time for solo developers on all those non-tech issues. You may not know that I planned to release my app in August! But now it’s November!
Anyway, perhaps what I’ve got is the best I can get, so now I can focus more on tech things to make my app more polished.
Update: AppShopper.com has a page for Gomoku now: http://appshopper.com/games/gomoku
(Thanks Robin Lu!)
So, finally I’ve got my activation code working, actually Apple sent me the right code, but in wrong format like 1234-5678-ABCD-EFGH, that doesn’t work. Then another guy from Apple told me to enter 12345678ABCDEFGH, and it worked, I’m a bit speechless. It seems that something is not quite consistent in the program.
And next step is to set up a contract with Apple, since I’m going to sell my apps. Things are a bit complicated again. Why don’t they use some lightweight method like Western Union? Google uses that way to pay AdSense publishers in China. And Apple uses SWIFT code to transfer money, and I guess this is quite new for most people. One more thing is that W-8BEN is required to be mailed to Apple for foreign developers.
I hope all those non-tech stuff could be settled down before December.
I just encountered this problem and finally got it working. Here are some tips if you’ve experienced the same problem:
- Try create a new iPhone project in Xcode, and your distribution provisioning profile will show up in the new project. Then back to the problematic project, you may get lucky.
- Enter
iPhone DistributioninCode Signing Identity, selectCode Signing Provisioning Profileand press delete. Switch to distribution configuration and build, if you got lucky, you’ll be prompted about permission or somethingKeychain, clickAlways Allow. After build, you may find distribution provisioning profile showing up. - You’ll need to generate and request different certificates for Developer profile and Distribution profile.
- Actually you don’t need to enter the name part in
Code Signing Identity, justiPhone DeveloperandiPhone Distributionis enough for Xcode to locate these profiles.
Since Xcode behaves strange and different from what Apple describes in program portal guide, this could be a bug and I hope it gets fixed in next version of Xcode. I believe that many people were mad about this.
After update to the latest version of Adium, I found it can support offline message in Live messenger protocol, cool.
Every iPhone native app crashes.
Something really hard to address is, when app is running very smooth in simulator, it crashes much more often in real devices. Especially for apps reading a lot data from Internet.
I really want to find a list of tips about reducing crashes, or should I make my own? And I wish Apple could add more RAM to next generation iPhone.
VLC, MPlayer and Perian are three major choices for playing media files on Mac OS X, most otakus who download and watch a lot videos usually have all of them. If you don’t care about subtitle support, then MPlayer could be good choice, it has fast and reliable seek-n-play for MKV and other H264/X264 videos.
But when subtitle and performance came to a problem, the three players have very different routines to handle.
VLC

Cross-platform media player works on Windows, Mac, Linux, BeOS, Solaris, Syllable, NetBSD, OpenBSD, FreeBSD, for various audio and video formats.
Website: http://www.videolan.org/vlc/
- A sophisticated control panel to let you configure font render module, type face, style.
- Supports ASS/SRT formats
- Latest version, 0.9.3, seems to have the defects of seeking
- Older version, 0.8.6i, cannot support anti-aliasing font scaling
- Too many clicks in the complicated dialog for opening video and subtitle together, bad user experience
MPlayer
![]()
Cross-platform CLI player works on Windows, Mac, Linux, BeOS, Solaris, Syllable, NetBSD, OpenBSD, FreeBSD. On some platforms there are GUI front-ends.
Website: http://www.mplayerhq.hu/
MPlayer OS X: http://mplayerosx.sourceforge.net/
MPlayer OS X Extended: http://mplayerosx.sttz.ch/
- Very poor ASS support
- Overall poor subtitle support, MPlayer OS X Extended has some support for customizing font style
- Fast and reliable seeking
- Better H264/X264 framerate compared to VLC
Perian

A free, open source QuickTime component that adds native support for many popular video formats. For Mac OS X only.
Website: http://www.perian.org/
- Not as fast as MPlayer when play H264/X264
- No way to customize font style, but the default style is really polished and beautiful
- Mature ASS support
- Load subtitle automatically
Conclusion:
For overall experience, Perian is recommended for its relative mature subtitle support and reliable framerate.
Disclaimer:
This post is based on my experience with the three players, I use them mostly for playing MKV and other H264/X264 formats, in HD quality. My testing machine is a MacBook Pro 17-inch with Core 2 Duo 2.5G and 4G RAM.
Feel free to correct me in comments if you find anything wrong in this post.
This is the 3rd National Day week I spent in Shanghai, except two days in Hangzhou, my otaku lifestyle hasn’t changed much. I watched two anime films by Makoto Shinkai: 5 Centimeters Per Second, Voices of a Distant Star.
1080P version of 5 Centimeters Per Second is amazingly awesome, I mean the detailed graphic, almost every single frame can be captured and set as desktop wallpaper. That’s the quality of commercial studio production.
Something is quite memorable in Voices of a Distant Star, if one day your girl friend is traveling to a distant star, and all messages sent from her would take years to deliver, because a distant star means a star in light years far away. Then?
You two are connected, because you’re keeping missing each other, so no matter how many light years away, you’re connected.
Actually I wish I could have one connection like that. Such connection is not meant for telling stories to others, but just a connection that will be kept in hearts for many many many years.
I just found that Apple has got an excellent list answering most common coding questions like how to tell is code running on iPhone or iPod touch?
http://developer.apple.com/iphone/gettingstarted/docs/gettingstartedfaq.action
I still hope there will be an official place for developers to discuss iPhone coding problems, like they’re doing in Adobe Labs, with forums and wikis. Currently some developers go to discussions.apple.com, which is not the best place IMO, because most people there are regular users, not developers, and discussion categories are defined for regular users too.


