iPad icon size ≠ iPhone icon size

Ipad_curling_icons

Just noticed our iPhone icon looked funny when run on the iPad.  It seems, at least on the simulator, the iPad app icon size is 72px, different from the 57px on the iPhone.  Here's a screenshot of how the 57px icon looks against a 72px icon.

Filed under  //  icon   ipad   iphone  
Comments (0)
Posted

iPad beta SDK cannot compile iPhone apps for distribution

Cross-posted here.

Learned this the hard way... if you upgrade your Xcode to the iPad beta (iphone_sdk_3.2_beta_with_xcode_3.2.2.dmg), you cannot compile iPhone projects in distribution mode, even if you set the target device to 3.0/3.1.  I'm not 100% certain what build configuration flag is causing this to fail, but it compiles just fine in my other configurations and I can even run the non-distribution mode build on an emulator.  In distro mode the build always craps out with 18 C++ errors (similar to this).  It's possible that the issue is also related to the fact that I recently migrated to a new macbook, but I had already reinstalled Xcode so I can't imagine that being the issue.

I just downgraded my Xcode to the latest non iPad version (iphone_sdk_3.1.3_with_xcode_3.2.1__snow_leopard__10m2003a) to confirm this, and was finally able to submit version 1.0.2 of Cool Curlings.

Filed under  //  ipad   iphone   xcode  
Comments (0)
Posted

Weird Xcode bug

I'm not even sure if this is an Xcode (well, Interface Builder, really) bug or something in our code, but one of our images titled "menu.png" was showing up weird in Interface Builder.  When you run it in the iPhone simulator, everything looks fine, but whenever we opened up our HighScoresView.xib, it would show some weird menu image instead of menu.png, and in the attributes it would show "menu" (without the file extension).  This would go away once we added the ".png" but if you save and reload, the same thing would happen.  Upon inspection of the xib file, it would appear the file is saving correctly:

<string key="NSResourceName">menu.png</string>

but I guess Interface Builder opens it up wrong.  Although this doesn't affect our end product in anyway, we ended up just renaming the file menuu.png and this problem went away.  Strange!

(download)

Filed under  //  bug   curling   interface builder   iphone   xcode  
Comments (0)
Posted

Running interpreted code in an iPhone app

3.3.2 An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Apple’s Published APIs and built-in interpreter(s).

An iPhone app we are developing will at some point have downloadable content, where a user can download levels.  In order to implement the grading algorithm, we were looking into dumping some Lua script with each level and having an interpreter.  The quoted statement above disallows this, but we've found an alternate solution.  This is nothing new by any means, but it's not always the most obvious.  UIWebView#stringByEvaluatingJavaScriptFromString can parse JavaScript, and therefore is exempted by the "built-in interpreter" clause.

in Utils.m
... // in initialization
webView = [[UIWebView alloc] init];
...

-(CGFloat) evaluate:(NSString*)script{
    NSString *eval = [webView stringByEvaluatingJavaScriptFromString:script];
    return [eval floatValue];
}

in GameScreen.m
... // in grading method
NSString* script = [[NSString alloc] initWithFormat:
  @"var xi=%f, yi=%f, xf=%f, yf=%f, dx=xf-xi, dy=yf-yi; Math.sqrt(dx*dx + dy*dy)",
  xi, yi, xf, yf];
CGFloat eval = [[Utils instance] evaluate:[script autorelease]];
...

This returns the distance between (xi, yi) and (xf, yf), and if we wanted another level to calculate the Manhattan distance or ignore the y axis altogether, we can simply load a different script with the level and we're set. All without getting flogged by the Apple gestapo, whew!

Filed under  //  apple   curling   dev   iphone   javascript  
Comment (1)
Posted