Friday, 20 March 2009

Number Invaders is live on the App Store


Whatever rumors you may have heard about App Store approvals recently taking a long time I can confirm that in my case it took almost exactly one week to go from submission to approval. Once you get past the hurdle of preparing all your assets and assuming that you have a bug free and leak free App it seems that Apple is quite quick in approving free Apps. When they've approved it you get sent an email from iTunes Connect saying that your App is "Ready for Sale" and is apparently on the App Store. However, it does seem to take a while for the App Store Search Indexing to figure out your App exists as over the first 24 hours I actually had quite a hard time finding Number Invaders and could only search for it using the company name "eLounge". Now it is coming up properly with a search on "Number Invaders". It's also quick amazing to see how quickly the game gets spread over the internet and it's fun reading comments of others about the game. I've had a couple of feedbacks so far related to the high quality of the graphics but the rather poor quality of the sound. If I could just get my hands on the real thing to record the sound I'll send thru an update with decent sound effects. 

Still, it's a real buzz to have finally published a piece of software that is actually used by real people rather then just big corporations and it's a real spur for the next iPhone project (whatever that may be).

Wednesday, 18 March 2009

kiwired.co.nz is up

In order to get your iPhone App on the App Store you need to provide Apple with a support website. This was a bit of a problem for me as although I've reserved www.elounge.co.nz I haven't got around to paying for the hosting of it yet. For the time being I've borrowed space on a friend's website and elounge can be found at www.kiwired.co.nz/elounge. The webpages themselves were developed quickly one morning using iWeb, which comes packaged with iLife on all Macs. I was very impressed with iWeb. I've tried building websites before and as a beginner I've found iWeb to be by far the easiest to learn and use. More content will be provided soon but for now it's onto iPhone SDK 3.0 and the next big thing.

Sunday, 15 March 2009

Submission complete

nInvaders has been submitted to Apple as of 11 March. I've read a few horror stories about the backlog of iPhone App approvals which Apple is having to deal with so I'm not exactly waiting with bated breath for any feedback, but will put a post up as soon as any arrives. The whole process to submit the App was a little laborious. If I were to do it again it make sure I had the 512x512x72 blowup of the icon ready to go, the write up complete and the screen shots taken. Apple has a presentation video on the iPhone Connection website which is very handy in preparing you for all the assets you need to have in place before you can successfully submit your App.
Now that that's done it's back to moneyLounge development. I was never very happy with the presentation of the Tree View so I'm doing a little rework of that interface to clean it up. Next Saturday I also have a photoshop course to attend so I'm hoping that'll speed up my graphics development and make everything a whole lot prettier. It's all very well to have a elegant set of classes and data structures but no one really sees that - a nice icon and some fancy pictures makes all the difference.

Thursday, 5 March 2009

nVaders

My first iPhone App is now complete and ready to be submitted to Apple for the iStore review. Some awesome graphics work from Sam Douglas over the past week has given a real sparkle to the game, including the neat little icon shown here. Now I just need to get a bigger version of icon made of the iTunes Store and a webpage thrown together and it'll be all good to go. It should be neat seeing people actually downloading it and since it'll be free we're assured of some market.

Thursday, 5 February 2009

Universal Binary

I just copied moneyLounge across to my old Mac G5 and, too my horror, discovered that it wouldn't even startup. I was getting the message "invalid architecture". Some hunting around on google quickly determined that I needed to compile a universal binary version of moneyLounge. This is done simple by changing the "Architectures" setting in the Build properties of the target. I'll guess this means I'll need two targets from now. All went well except for one interesting (and hard to track down) run error. This concerns the use of code such as:

int row;
if(row==NSNotFound) then ....

In the native architecture of my Intel Mac this code would work fine, but in the 32/64 bit Universal version it didn't. This was because NSNotFound is defined as the largest possible long datatype rather then integer. I guess this is the difference between the 32 and 64 bit versions. The upshot of this was that I recoded all my "int" datatypes to NSUInteger, making the code a lot more generic in any case. Something to bear in mind I guess - try and use the NS datatypes rather then the simple C versions.

Tuesday, 3 February 2009

Number Invaders


moneyLounge has reached a stable build now and I'm actually able to use it for my day to day finances. That means I finally have a replacement for MS Money on the Mac that I can actually use. There's still a few bits and pieces that could be improved upon and I intend over the next few days to test the release on my G5 and also give it to a few users to beta test. But for the past couple of weeks I've been happily working on my first iPhone Project - Number Invaders. It's a simple game based on the old 1980 Casio Calculator game where you 'shoot' numbers advancing across the LED display towards you, and it has turned out to be an ideal introduction project to iPhone development, as it involves simple graphics, timing events and GUI development. The actual coding is very similar to standard Mac Cocoa and Objective-C and so far the hardest part has been getting the setup and configuration working. If you're intended to join the iPhone developer program and setup your Mac then I would encourage you to visit Ralf Rottmann's guide as he takes you past all the potholes that Apple has often neglected to document. I now need to get Calculator Invaders ready for the App Store and I'll try to be a little more regular at updating my blog of with what happens thru the Apple QA process.


Saturday, 13 December 2008

Download share price history from Yahoo Finance

This problem took me a little while to figure out so I'm pretty happy that I've finally managed to get it working, and with a pretty simple solution. The crux of the problem was how to fetch from the internet a share price history for any given stock over a period of days, months or even years. As it turns out yahoo.finance offers a HTTP page which nicely returns this information for you. The format of the page address looks something like this:

http://ichart.yahoo.com/table.csv?s=MSFT&a=01&b=00&c=2007&d=31&e=11&f=2008&g=d&ignore=.csv

where:

s=the stock code and stock index if outside the US (i.e. MSFT or TEL.NZ)

a=the day of the month for the start date

b=the month of the year for the start date. Note that months seem to start from 0 so Jan is 0 and 11 is Dec

c=the year of the start date

d=the day of the end date

e=the month of the end date (also convert to go from 00 to 11)

f=the year of the end date

This web query can be used in a browser to return a list of share price data for the named stock from the start date to the end date. The list will show the opening value, closing value, and other data for each day in comma separated format. You simply need to parse this result set in a loop and use it as required.

In the sample code below I've made use of the NSURL and NSData objects to grab the data. Note, this code is reference only. It won't actually work, it's just to give you an idea of how this is done:


httpString = [NSString stringWithFormat:@"http://ichart.yahoo.com/table.csv?s=%@&a=%@&b=%@&c=%@&d=%@&e=%@&f=%@&g=d&ignore=.csv", stockCode, firstMonth, firstDay, firstYear, lastMonth, lastDay, lastYear];

NSURL *url = [NSURL URLWithString:httpString];

NSData *data = [NSData dataWithContentsOfURL:url];

NSString *s = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];

NSArray *lines = [s componentsSeparatedByString:@"\n"];

NSArray *line;

for(i=0;i<[lines count];i++) {

 sCurLine = [lines objectAtIndex:i];

 line = [sCurLine componentsSeparatedByString:@","];


 /* the download should always contain 7 fields, but yahoo might change this at any time */

 if([line count]==7) {

  thisDate = [NSCalendarDate dateWithString:[line objectAtIndex:0] calendarFormat:@"%Y-%m-%d"];

  thisPrice = [[line objectAtIndex:4] floatValue];


  /* thisDate and thisPrice should now contain the date and price for this entry in the download (most recent first) */

  }

}