The application-identifier entitlement is not formatted correctly

This is not well documented by Apple, as far as I am aware. If you get an error stating “The application-identifier entitlement is not formatted correctly” when uploading an app to Apple, here is the solution.

  1. Delete your old Entitlements.plist if you have one.
  2. Create a new file of type “code signing,” “entitlement.”
  3. Clean and build.

There are two new “identifier” fields in the entitlement certificate that were not present before. It has nothing to do with the “get-task-allow” field you’re used to fiddling with for ad-hoc builds. May the upload gods bless your new binary.

Posted in Uncategorized | 2 Comments

XCode Screenshot Location

Because I can never find this when I need it, here is the location where XCode stores screenshots:

~/Library/Application Support/Developer/Shared/Xcode/Screenshots

To take screenshots for the iPhone, iPad, or iPod Touch, go to Window –> Organizer and click on the device within Organizer. You’ll see a tab titled “screenshots.”

You can also drag and drop the screenshots from the Organizer to Desktop or a folder of your choice.

Posted in Uncategorized | Leave a comment

Debugging an ad-hoc build

I don’t think you can debug an ad-hoc build of an iPhone app using XCode or Instruments. I thought it was possible, but after much failure I’ve decided I was fooling myself. But you can do the same build with your developer certificate and it will work fine, even with release settings of course. Wouldn’t it be useful if all the certificate crud yielded useful error messages?

Posted in Uncategorized | Leave a comment

NSLog and Performance

Just a note to those who are tempted to troubleshoot performance while in debug mode. All those NSLog statements (if you’re like me, you have hundreds of them for debugging/testing as you go) can have a definite, visible impact on performance. Try turning debug mode off and see if you still need to tweak anything. You do have a wrapper for NSLog so that your debug statements go away when you switch to release, right?
Of course, Shark will probably point you in the right direction. But wouldn’t you then smack your own forehead?

Posted in Uncategorized | Leave a comment

Speaking of leaks

… I’m happy to say I have another leak free app ready for the app store ;) Well, almost. It needs a beta test of course. I’ll post more about it later. It is small, free, and I hope mildly amusing.

Posted in Uncategorized | Leave a comment

3.5K thread leaks

I like the Leaks tool a lot. It can, however lose track of a data structure used to track a thread. There is a post here: https://devforums.apple.com/message/119423#119423

The case discussed is a 3.5KB leak originating from -[NSThread start] . I detected the same non-leak and am glad I searched online before spending too much time trying to track it.

I believe the same thing can also happen using AVAudioToolbox, detected as a 3.5KB leak originating from -[CAPThread::Start()] . I pointed out the connection (correctly I hope, but I did say “it may be”) on this thread: http://stackoverflow.com/questions/2946749/iphone-help-with-audiotoolbox-leak-stack-trace-code-included-here/3039819#3039819

So to keep this short, I hope the information will keep someone from pulling out hair thinking they have a leak when they do not.

Posted in Uncategorized | Leave a comment

Data driven

The half-waking mind brings strange visions. I give you The Book of Data Exodus.

Will the master bow before the servant? Are there riches in the promised land? And most pressingly: should manna be served with, or without, a garnish of fresh vegetables?

Posted in Uncategorized | Leave a comment

Battle of the String

This is a post about NSBundle’s pathForResource. My code pseudo-randomly selects between 3 “banners,” which are HTML files inside my project.

There are some battles worth fighting, I have found, and some not. Maybe on a rainy day I will figure out why this works:

int whichBanner = (arc4random() %3) + 1; // random 1 to 3
DLog(@"selected banner *%d*", whichBanner) // a formatted NSLog defined inside #ifdef debug
NSString *bannerPathString = @"FloracleBanner"; // starts the string
NSString *filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"FloracleBanner%d", whichBanner] ofType:@"html"];
// previous line: gets pathForResource and appends "whichBanner" to string all in one line
DLog(@"filePath constructed is *%@*", filePath) // logs "/convoluted-path/FloracleBanner3.html" etc as it should

…And yet this does not:

int whichBanner = (arc4random() %3) + 1; // random 1 to 3
DLog(@"selected banner *%d*", whichBanner) // tests OK so far
NSString *bannerPathString = @"FloracleBanner"; // starts the string
bannerPathString = [bannerPathString stringByAppendingFormat:@"%d", whichBanner]; //appends whichBanner to the string, with (presumably) same result as the working method
DLog(@"determined filename for banner before extension is *%@*", bannerPathString) // and to confirm that, this tests just fine, with no hidden spaces or linebreaks (that's why I surrounded it with asterisks...) value is something like "FloracleBanner2"
NSString *filePath = [[NSBundle mainBundle] pathForResource:bannerPathString ofType:@"html"];
DLog(@"filePath constructed is *%@*", filePath) // logs filePath is *null* ... well, Hell.

So, both appear to be doing the same thing, yet only the first way works. There is probably someone who can explain this. I can not, nor have I found an explanation. My solution is to use the shorter, slightly-less-explicit version and move on.

Posted in Uncategorized | Leave a comment

Rotations with CABasicAnimation

When you use CABasicAnimation to rotate a layer, there are some annoying features to watch out for (annoying to me, anyway). For one, if you specify a transform with a rotation of 360 degrees (translated to radians), Core Animation will helpfully take the shortest path. That is to say, it will do nothing.

I guess I shouldn’t complain. After all, if I made a long, complex circuit and then allowed the positive and negative leads to occupy the same space, I should not expect anything better than a short circuit.

The best solution is the code provided by Jason Medeiros on this stackoverflow topic.

Other solutions I have tried involved repeating a rotation of 180 degrees or less several times using the repeatCount property. It looks like another poster took a similar approach. The problem with this approach is that there is a slight hiccup between repeatcounts. It seems to be more noticeable with larger images, probably because the object is jumping back by some fractional angle between rotations.

Edit: getting a little more specific, it looks something like this:

[theLayer addAnimation:(CABasicAnimation*)[self animationForRocks] forKey:@"animateLayer"];

- (id)animationForRocks {

CABasicAnimation* spinAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
spinAnimation.toValue = [NSNumber numberWithFloat:.01*2*M_PI];
spinAnimation.repeatCount = 10000;
spinAnimation.cumulative = YES;

}
Posted in Uncategorized | 1 Comment

Floracle

My iPhone and iPod Touch game, Floracle, is available in the iTunes app store. For more information, please see www.eat-entertainment.com. The direct link to the app store is HERE

Posted in Uncategorized | Leave a comment