停止空想

老张的空中之家

存档于 三月, 2009

Fix error (0xE8000001) For iPhone

作者:admin 发表时间:三月 - 30 - 2009

http://www.ilouyou.com/2009/02/fix-error-0xe8000001/

Ok, first trick, sometime somehow, you get a popup in XCode: “Your mobile device has encountered an unexpected error (0xE8000001) during the install phase:….”, there’s one way you can try(but not for 100% suer you can fix it).

  1. Use any ssh or sftp tool login into you iPhone(you must jailbreak it anyway~~)
  2. cd to “/var/mobile/Media/PublicStaging”, delete the app of your project name, that’s all!
  3. Rebuild your code and try.

如果你的手机按照提示,关机,重连,但是还是有该死的错误,如果手机是jailbreak,那么按照上面的方法吧。如果是有合约的,那么在organizer 窗口里面直接restore 手机

类别:iPhone

给sqlite数据库加密的两种方法

作者:admin 发表时间:三月 - 30 - 2009

一个是采用SQLCipher

Need to store sensitive information in your app? SQLCipher extends SQLite enabling transparent encryption and decryption of data using AES. Its source is available on Github.

SQLite is pluggable. Developers can create extensions and chain them into SQLite’s engine. Using this mechanism, SQLCipher embeds itself low enough in the stack to be transparent. As a developer, you simply issue queries as you normally would and all of the crypto is handled transparently.

阅读全文 »

类别:iPhone, sqlite3

让iphone不使用定位的cache(转)

作者:admin 发表时间:三月 - 28 - 2009

A short note on CLLocation / CLLocationManager

**** DEPRECATED **** Use http://liip.to/ilocator

Well.. I’ve been testing this Locator quite a while now. Today I had my final attempt, to find out, why I always got either a cached location or an extremely inaccurate location.

Today, I went out with my notebook (yes, there where the sun is..) to debug.

The example of apple says, to check the timestamp of the newLocation. (It should be less than 5..). Yeah well, guess what - it is sometimes 0 in a cached location. And somehow it’s sometimes just a bit over 5 and you’ll have to wait forever to get a new location.

- (void)locationManager:(CLLocationManager *)manager
    didUpdateToLocation:(CLLocation *)newLocation
           fromLocation:(CLLocation *)oldLocation
{
    NSDate* eventDate = newLocation.timestamp;
    NSTimeInterval howRecent = [eventDate timeIntervalSinceNow];

    if (howRecent < -0.0 && howRecent > -10.0) {
        [manager stopUpdatingLocation];

        // USE THE FORCE OF THE LOCATION!
    }
}

This one should work. Maybe that location stuff is working in the U.S. but it wasn’t in Switzerland..

P.S.: I had another issue with a pwned iPhone today. NSXMLParser throw me errors back and I didn’t know why.. I still don’t know why, I guess it had to do with the libxml2 update I did. Workaround? Restore, works fine now.

类别:Cocoa, iPhone, 苹果