Thursday, April 19, 2012

Clearing NSUserDefaults

I needed to remove all the settings from an app, and there's not an easy built in way to do it.  While it seems like it might, this does not do it:
[NSUserDefaults resetStandardUserDefaults];
But this does:

NSDictionary *settings = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
NSArray *keys = [settings allKeys];
for (int i=0; i<[keys count]; i++) {
   NSString *key = [keys objectAtIndex:i];
   [[NSUserDefaults standardUserDefaults] removeObjectForKey:key];
}
[[NSUserDefaults standardUserDefaults] synchronize];

Sunday, April 8, 2012

Google, you're getting worse.

So Google, you can no longer search for something, and then copy the link?  Links now redirect thru your servers(!), and who knows what personal info they may contain, so I'm not ever going to just post one of those redirect links.  You have to click the link, then get redirected to the real webpage you wanted, then copy that URL.  Much more of a pain.

The IDs are much longer in the real URL.
http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=XXXXX&url=http%3A%2F%2Fftponthego.com%2F&ei=xi-XXXXX&usg=XXXXX&sig2=XXXXX

And in addition to being much more annoying for pasting URLs, it may be only a fraction of a second, but that extra redirect thru your servers takes time.  Google has long pushed speed and quality of results over everything else...but not anymore.  Bing doesn't do this.

Friday, March 30, 2012

Windows 8

My thoughts on it are pretty similar to this.  Metro seems much better for a tablet or phone size & touch than it does for a desktop size screen and a mouse.

Unless they change some things between the preview and the release, Windows 8 will be more of a learning curve for existing Windows users than switching to a Mac.  That's something that should terrify Microsoft and PC makers.

Wednesday, March 28, 2012

Tapose

Tapose is an interesting app, and shows what an alternate universe might have been like if Microsoft hadn't killed the Courier project.

And while interesting, it also shows some good reasons why Microsoft was correct to cancel the Courier.  It would have had two physical screens with some separation between them.   Without the ability to slide the center like this app does on the iPad's single screen, Courier would have always been weird for anything other than this sort of tool.

Saturday, March 24, 2012

Handy Graphics Tricks

This is one that Pete came up with, for cards in our poker apps, but it's worth mentioning again with the new iPad's retina screen needing even bigger graphics. And we did a slight variation in Knife Dancing too.

All the hands in the game are really recolored versions of the same hand photo to have different skin tones.  So they're exactly the same shape and outline.  Pete saved them as 8 bit images, which for the hands looks good, but the blending along the edges isn't as nice.  It's hard to see here but there's an outline around the hands for the edge blending that happens next.

Pete made a separate 32bit version that does have all the levels of alpha at the edges, but just blank for the hand part so very small to store.  All 4 versions of the hand can share this one alpha image!

Then in the app I combine them on the fly into one graphic.


CGRect  rect = CGRectMake(007681024)
UIGraphicsBeginImageContextWithOptions(CGSizeMake(768, 1024), NO, 0.0);
[[UIImage imageNamed:@"ipad-hand1-8bit.png"] drawInRect:rect];
[[UIImage imageNamed:@"ipad-hand-alpha.png"] drawInRect:rect 
          blendMode:kCGBlendModeDestinationIn alpha:1.0];
theHand.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();


The iPad retina hands saved normally are over 7MB(!)  Using these split and shared images it reduces those to 2.5MB.

Thursday, March 22, 2012

4.6" screen thought

iPhone rumors flying.  Apple ordering screens doesn't mean they'd make it into an iPhone.

Measuring, the trackpad on my 13" MacBook Air is about 5".  Pretty close to that 4.6" screen rumor.  Wonder if it could go there...

Wednesday, March 21, 2012

Retina iPad Dilema

New graphics on the new iPad 3's screen look amazing.  But they really do make the apps much bigger.  Individual images can be up to 6MB!  (Like in this app, where we want image quality the best, no matter the size.)

It makes a difficult choice, especially for Universal apps that run on both iPhone and iPad.  For a long time the limit for an App to be downloaded over the cell connection was 20MB.  The iOS 5.1 update did increase that to 50MB.

But since it's done by the iOS version on the device and not the App Store server, anyone who hasn't upgraded still has the 20MB limit.  People upgrade pretty well, but looking at some stats, it's likely that half of the people still haven't upgraded to 5.1 yet.

Even if the people are upgrading from 5.0x to 5.1 quickly, that 20% on iOS 4 are upgrading very slowly. At this point many months after 5.0 was released, I doubt they really are "upgrading." They're getting upgraded as they buy a new device.

I don't want to throw away between 20 and 50% of potential customers, especially on some sillier apps like Knife Dancing that are downloaded quite often while out and on a cell connection...most likely there are drinks involved too.  Same for Pawn'd, we're putting in the iPad Retina graphics and it looks amazing, but it will push it way over the 20MB limit for older devices to get with a cell connection.

We're trying a hybrid approach for some apps.  Upgrading buttons and things that contain text because the small curves with high contrast in text show the most pixelation when not upgraded.  But leaving some other things alone for now.  (We did that for Knife Dancing, plus some tricks Pete did with double images, coming in at a bit under 20MB.)

We're seriously thinking of making the planned free version of Pawn'd be iPhone only to keep the size down, and maybe a separate HD version for iPad...or just add the Universal part in a few months when more people have upgraded.