How to find your resources and how to generally find the directory layout

To find the main download directory for when you are receiving files, put this snippet of code in a test project or your main project at the point of opening:

 NSArray *pathsForDownloadedFiles = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
 NSString *pathMain = [pathsForDownloadedFiles objectAtIndex:0];
 NSLog(@"main download directory is [%s]", [pathMain UTF8String]);

The first line lets you allow Apple to put the application download directory anywhere it likes. It will also be able to change it at will, without breaking your program.
The second line means that there is only one directory you need to access and its the first one. Remember in C arrays are zero based which means the first element of the array is at index number zero not at index number one.
NSLog will let you run the app in the simulator OR on your device and send logging information back to the debug console in XCode. Nice and integrated.

An alternative method:

 NSString *mainPath = [self getDataPath];

Uhhhhh yeah a bit shorter. Its not deprecated from what I see so one can use this method also.

Finally lets see where our resource is. Again, if you use this method, then XCode will be able to re-layout the resource directory structure anyway it wants without breaking your program. You KNOW they’re going to do this someday and they won’t tell you until its been done. So lets Program Defensively. Just like you drive defensively.
To find a specific resource that was compiled into your application:

 NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"mission1" ofType:@"jmf"];
 NSLog(@"Path for mission file is [%s]", [resourcePath UTF8String]);

The AT (@) sign is the NSString constructor without declaring an NSString. In case you’re wondering.

Good Luck and God’s Speed to ya mates.

iPad – The Conqueror

I went to Best Buy and they had the requisite four iPads to touch and feel and play with. Lots of kids/teens/college age. They were all over everything, the macbooks, iPads, everything that was there. It was “an event” for them. The fun they were having, the giggling, “makes” the sale as much as the device. It was like watching one the “cool, hip” commercials. Continue reading

Gruber is not completely correct about Apple’s policy change

This post was sent to me about Gruber’s analysis of the new Apple policy (3.3.1) that stated that developers were not allowed to use third party development tools that could target multiple mobile phone platforms. We were looking into these currently and I have to say I’m quite miffed. Continue reading

NO JOY. An OS 3.0 upgrade story

Went to the iTunes store to upgrade one of my iPods to the OS 3.0 SDK to see if we can monetize the crap out of it. Hey, I’ve BEEN BUSY, so shutup.
Anyway, No joy. An UNKNOWN ERROR occurred on my transaction.
I will report back on this when I solve Apple’s problem (again).
Update and FIX:
The error was “An Unknown Error Occurred (1004)”. Continue reading

HOLY CRAP BATMAN SNOW LEOPARD’S GOT ME

Face (our undead President) close your eyes and skip this rant.
Ok folks, spent the whole $25 in cheeseballs on the OS X upgrade.
Those *beep* *beep* *BEEPITY* *beeps* (edited by Face) at Apple have completly wiped my XCode links to the SDKs. NOTHING BUILDS NOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
HOLY **** Batman!
I’ll update here about this crap. GREAT! Like we need MORE WORK. Of course WE’LL be blamed for this. Those BEEEEEEeeeeeeeeeeeeeeeeeeeeep (edited by Face).
-T-
Update:
Ok my fault, when I upgraded, I should have put XCode 3.2 into A NEW PLACE!!! otherwise it “upgrades” your existing install (assuming you used the defaults) by erasing all your SDKs! How intuitive. Yeah if I RTFM. Ok so the way out is to download the OS 3.0 SDK which “doesn’t have all the 2.x SDKs”. Hmmm Let’s see nope. No more ranting. By this time you want answers.
I’m doing that right now and its taking 20 minutes for 404MB.
The original solution is to install the new 3.2 Xcode into A NEW PLACE and DO NOT UPGRADE the existing installation. Well they at least got that part correct.

Where is our CTO? And who really cares?

Yesterday I received an e-mail from a partner asking where our third partner and lead developer is. Like the rush of Niagara Falls, thoughts of South Carolina governor Mark Sanford taking off for Argentina and telling no one went though my head. Then there was Steve Jobs: He nearly died, and no one holding Apple stock, most of the value of which is Steve himself, knew anything about his condition.

Rest assured, Tom is not duplicating the efforts of either of the above shady characters. He is taking a rare break from developing device drivers all day, and developing web apps all night, to spend some time with his family.

I do not miss the twenty-something e-mails a day that each details some new, advanced system or method that gets Tom all excited, but which I could care less about. For one week I have been able to spend most of my time communicating with magazine editors, developers, and users in the tech blogs, continually trying to figure out what we can do for them. People are awesome. Life was never better.

Alas I fear the honeymoon is over, and I will be chastised for my marketing prowess and lack of high level tech insight any minute now…

JB