So, API does change between OSX versions.
RhapsodyX has been released for a total of 24 hours, and it turns out that there was a huge Tiger bug – it didn’t even load. Apparently a new message was added to NSMenuItems allowing you to get the view of an item. I was using this to ensure that nothing was updated while the view was visible. If you do, this can cause crashes.
That fix worked – I hadn’t gotten a crash related to that problem since I made the change. Unfortunately, it also turned out that this message doesn’t exist in Tiger. Of course since I did a basic usability test on Tiger before release (without connecting) I figured everything was good to go considering I was compiling on a 10.4uSDK (Tiger API). Well, I was wrong.
One thing that I missed is that there was a problem with NSXMLParser’s class method initWithContentsOfURL. I believe that the Tiger version of this API does not have the capability to use a web URL to go through the steps of opening up a socket, making a HTTP request, downloading and then parsing, thus giving a fantastic null result. It took a good amount of time to figure out the problem because I was effectively Black Box testing my app since the Tiger machine I was using had no XCode installed. I figured it was a different method of the NSAutoreleasePool possibly releasing things earlier on Tiger than I had expected, but it was the URLs all along.
I moved to another set of APIs that leverage WebKit - thus the 1mb increase in executable size. The program now uses NSURLRequests and NSURLConnection to download the data from Rhapsody’s servers. Here’s the set I used instead:
NSURLRequest* chRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy: NSURLRequestReloadIgnoringCacheData timeoutInterval:10];
NSError* theError;
NSData* response = [NSURLConnection sendSynchronousRequest:chRequest returningResponse:nil error:&theError];
Pretty simple. A few things to note are that this method would also fail provided the program did not get new data every time; this was fixed by the NSURLRequestReloadIgnoringCacheData constant, forcing it to reload every time. Additionally, I changed the timeOut interval just in case so that the program didn’t get stuck waiting for a response on a slow server. This minimizes problems, hopefully.
Well, there you have it. Thankfully, it works now. At least on my Tiger test computer… hopefully it also works on yours!