Some favorite site feeds aggregated locally: iPhone Development RSS   Adobe Labs RSS   Macrumors RSS

Monday, June 29, 2009

How you target 2.x with the 3.0 SDK...

Monday, June 29, 2009    0 Comments

If you are using the 3.0 iPhone SDK, you'll notice that by default Xcode only shows you 3.0 as a target (Simulator and device). Before you were able to target all the SDKs you had installed. I personally don't worry about this default behavior, but when you're building an iPhone application, you may want to target previous SDKs.

I read about this online someplace, and this will get 2.x available again.

  1. Select your project file and Get Info.
  2. Under the General tab, you'll see a drop down for Base SDK for All Configurations and choose your SDK there.
  3. You're done. You'll see all the SDKs listed now in the normal drop down you're used to using.

Labels:

 

James Last: Russia (1973)

   3 Comments

This one goes back quite a while, and you've probably never heard of James Last. Which is a bit understandable, because the only reason I know of James Last is through my father.

When I was a child (not too much older than the age my own son is right now), my father had a pretty extensive collection of classical LPs and some 8-tracks. He had a large home system with huge BA wooden speakers, tube-powered amplifiers, the best needle in the business, etc.

We used to make fun of his collection of music as being old fogey-type stuff, but we were really just trying to act cool. Some of it was amazing and fun. I've apologized several times in the past about how we used to make fun of this stuff. In many ways, classical and ethnic music is more powerful than any "spirit of the decade" music could dream of being.

My sister and I used to play the 8-track of James Last's Russia. A few of the tracks any way. You'd have to click through spots on the tape and wait for your song to start, I remember four rectangular green lights that would tell you which approximate spot the tape was currently in. I don't remember if you could flip the tape upside down or not, I think so.

Anyway... we used to play song two: "Kalinka" (an example only video link) which slowly builds up with choir to result in ripping horns and a thunderous beat with some Russian chanting (well, perhaps not chanting but we didn't know what they were singing). We used to bounce off the walls laughing and having a good time.

Another favorite was "Russian Folk Dance" (Russischer Volkstanz) - which has a similar pattern to Kalinka. Mad fun.

A few years ago my father gave me that 8-track from his collection in the hopes to transfer it to CD. I never got around to it, I'd have to go to a place with the capability, pay cash, etc. But it always burned there in the back of my mind. For a few years whenever I remembered that album, I'd take a spin around the internet looking for it.

Now that I actually have this album, you might want to look it up, it's extremely hard to find (I don't do torrents or anything like that so I can't help you there), but if you're up for some really awesome ethnic music with true power behind it (I'm not talking about Polkas here, I'm taking about great horns, moving compositions, a big symphony sound with some modern instrumentation, and a great choir) then you should look into it. It's different.

It's not on iTunes, unfortunately. Get the LP if you can (if you can play those anymore).

Perhaps my father, my sister and myself will be the only ones who really enjoy this album and that's fine with me, I just wanted to put it out there. I am going to soak in "Nicht der Wind" (Not the Wind) for the fifth time now. Headphones up.

Ahhh.

Labels: , ,

 

CocoaREST rocks -- build the next great Twitter client

   0 Comments

I just looked into sdegutis's CocoaREST library (for Cocoa and Cocoa Touch platforms) - which allows developers to interact with RESTful APIs.

It's mainly targeted at Twitter at the moment, but many more services are under development and you can add extend support for others (ie. extend Twitter support for use with it's Search API). Using it is actually fairly easy... build the next great Twitter client!

Here is a quick screen-shot taken of Tweetie running beneath the included example OS X desktop application:


Check this library out if you're at all interested in using it. It rocks.
 

Could not support development

   0 Comments

I have no idea why it happens, but I do know that it's an annoying part of developing for the iPhone. For the most part developing for OS 3 on the iPhone is a joy, really it is. But every Monday I come in to work and connect the device, fire up XCode and try to build to it finding out that I need to reboot the device before XCode can deploy to it.

It costs me only a few minutes time, but I wish it was something that would magically go away in the near future. It's monday, my caffeine quotient has not been met, it's rainy in Boston, and perhaps I'm a little gray at the moment.
 

Thursday, June 25, 2009

[iPhone] Getting images from your bundle without hardcoding

Thursday, June 25, 2009    0 Comments

Update 3. Better yet:
totalCount = 0;
NSArray *d = [[NSBundle mainBundle] pathsForResourcesOfType:@"jpg" inDirectory:nil];
for(NSString *s in d){
if([[s lastPathComponent] hasPrefix:@"image_"]){
totalCount++;
}
}
Update 2. Since the file structure normally gets flattened out within your iPhone application (I guess there are some compiler tricks you can do), you'll always be targeting the root of the app directory. With that in mind, you'll want to probably use some kind of naming convention to separate any special files you'd like to collect from the bundle. You can also use extension. Say collect up and get the count of all images in your bundle that are JPGs and contain "image_" in the title:
totalCount = 0;
NSArray *d = [[NSBundle mainBundle] pathsForResourcesOfType:@"jpg" inDirectory:nil];
for( int i=0;i<[d count];i++){
NSString *searchForMe = @"image_";
NSString *s = [[NSString alloc] initWithString:[d objectAtIndex:i]];
NSRange range = [s rangeOfString:searchForMe];
if( range.location != NSNotFound ){
totalCount++;
}
}
Boom.

Update. I'm a moron. I should have just looked into NSBundle.h.
NSUInteger jpegCount = [[[NSBundle mainBundle] pathsForResourcesOfType:@"jpg" inDirectory:subDirName] count];

You can get the number of a type of item in your bundle on the iPhone, and this can come in very handy. No magic numbers. This code example doesn't look in a resource directory, but you could supply the inDirectory with something like @"backgrounds" and thus build up arrays of images of differing types, etc. There may be a better way of doing this (ie. if you only want to get the count of the items), but I don't know about it yet.
NSMutableArray * imageArray = [[NSMutableArray alloc] init];
NSEnumerator * imageBundlePathEnumerator = [[[NSBundle mainBundle] pathsForResourcesOfType: @"jpg" inDirectory: nil] objectEnumerator];
NSString * imageBundlePath = nil;

while (imageBundlePath = [imageBundlePathEnumerator nextObject])
{
[imageArray addObject: [[[NSImage alloc] initWithContentsOfFile: imageBundlePath] autorelease]];
}

NSLog(@"Number of images loaded : %d", [imageArray count]);

NSImage * anImage = nil;
NSEnumerator * imageEnumerator = [imageArray objectEnumerator];

while (anImage = [imageEnumerator nextObject])
{
NSLog(@"image = %@", anImage);
}
Tada. I hope to find some more examples.

Labels: ,

 

Friday, June 12, 2009

City of Champions

Friday, June 12, 2009    2 Comments

Pittsburgh is yet again the City of Champions. We win a SuperBowl and a Stanley Cup. For a city to win one championship is special. Amazing win tonight beating Detroit in their own building where they had been so dominant.

Well done. Enjoy Pittsburgh... get to raise that banner in a new barn.

I ordered my gear a few minutes after the players skated around with the cup and it's all already backordered. Oh well, I can wait a little while.

"Lord Stanley, Lord Stanley, gimme the brandy!"
 

Flashbelt Fiasco

   0 Comments

I didn't attend Flashbelt. I have only read multiple tweets and blog postings about what happened. You can read more about that here.

I personally think that there is no place for this kind of thing at a paid professional conference. If it was held in the corner of a bar with cigars, beers, a laptop & a projector, I wouldn't think it was appropriate either.

There, I said it. Let's just hope this kind of thing never happens again.
 

Thursday, June 11, 2009

Flash rant for the day

Thursday, June 11, 2009    0 Comments

1. I can't wait for Apple to include Safari-specific audio controls. Too many websites activate Flash video audio by default and it's jarring.

2. I can't wait for Safari for Snow Leopard to allow plugins to crash without bringing the browser down with it.

Thread 14 Crashed:
0 com.apple.CoreFoundation 0x914663cb CFReadStreamGetStatus + 43
1 ...romedia.Flash Player.plugin 0x176939d1 0x173b8000 + 2996689
2 ...romedia.Flash Player.plugin 0x1768c43f 0x173b8000 + 2966591
3 ...romedia.Flash Player.plugin 0x1768c713 0x173b8000 + 2967315
4 ...romedia.Flash Player.plugin 0x1768c7c1 0x173b8000 + 2967489
5 ...romedia.Flash Player.plugin 0x1746b727 0x173b8000 + 735015
6 ...romedia.Flash Player.plugin 0x1746bab3 0x173b8000 + 735923
7 ...romedia.Flash Player.plugin 0x1746bf69 0x173b8000 + 737129
8 ...romedia.Flash Player.plugin 0x1746c362 0x173b8000 + 738146
9 ...romedia.Flash Player.plugin 0x1746c68d 0x173b8000 + 738957
10 ...romedia.Flash Player.plugin 0x176935ff 0x173b8000 + 2995711
11 libSystem.B.dylib 0x91fdc155 _pthread_start + 321
12 libSystem.B.dylib 0x91fdc012 thread_start + 34
 

Wednesday, June 10, 2009

[ot.steelernews rings]

Wednesday, June 10, 2009    1 Comments

The Pittsburgh Steelers got their rings yesterday and then many proceeded to go over to watch the Penguins playoff game versus the Red Wings. These rings are simply enormous, gaudy, and I think are pretty beautiful.