Home
iOS ARC trap
ARC will release object after block, so if something like AVAudioPlayer, you have to make a class variable to keep it, or else this player object will be release.
15 Jan 2013
Check how many client connected to your internet sharing on your mac
arp -i en1 -a
? (192.168.2.7) at c0:9f:42:8f:88:a2 on bridge0 ifscope [bridge]
? (192.168.2.9) at b0:65:bd:6e:e2:55 on bridge0 ifscope [bridge]
? (192.168.2.255) at ff:ff:ff:ff:ff:ff on bridge0 ifscope [bridge]
29 Nov 2012
Prevent iCloud backup your downloadable content on iOS
Today, I got our company ebook application been rejected AGAIN.
Approving application is a process of really wasting of time, and you need to got result after an week, even don’t know if will pass or not, so let’s learn more experience from the failure.
The reason that this application been rejected is: Item 2.23 in the “Apple Store Review Guidelines” - Should not allow iCloud backup files which is not User generated.
Since it’s ebook application we will download ebook content from server which is called “downloadable” and “not user generated” content. So according to the “iOS Data Storage Guidelines”, we should put those files into “
Our ebook application was persisted files in “
Why the second submission been rejected is: because we set the “Deployment version target” to 4.3 which is not support one important feature “‘do not back up’ attribute” for files, that’s why my solution, which just set attribute for downloaded ebook files as “do not back up”, was rejected again.
Files won’t be backed up only when been placed into:
- the application bundle itself
- the caches directory
- temp directory
So finally we used one solution is:
- Set the “Deployment target version” to 5.1 above (5.0 or earlier not support applying file attribute.)
- Move the ebook downloading files into “
/Library/<Application Support|Custom Dir>" - Apply the “com.apple.MobileBackup” extended attribute to the download folder.
Some references:
29 Oct 2012
Use bower in rails
Bower is a very good tool, it can help you to manage the javascript or css like the way of bundler.
This is what does the config file looks like:
{
"dependencies": {
"jquery": "http://code.jquery.com/jquery-1.8.1.js"
}
}
This is the command lines to use the bower.
$ npm install -g bower
$ mkdir -p vendor/assets
$ cd vendor/assets/
$ curl https://raw.github.com/gist/3667224/component.json > component.json
$ bower install
16 Oct 2012
jquery page scroll animation
$('html, body').animate({
scrollTop: $(".top").offset().top
}, 2000);
16 Oct 2012