Im trying to use NSURLHandle writeProperty to set a property on an NSURLHandle ive created. The documentation states that writeProperty returns a BOOL indicating whether the modification was successful. Mine returns YES, as in it was successfull. In my next line of code, I test to see if I can query my newly created property for key. It returns nil.
begin code
- (void)getSelectedSong

NSString *)theSongURL {
NSURLHandle *songHandle = [[NSURL URLWithString:theSongURL] URLHandleUsingCache:NO];
[songHandle writeProperty:[theSongURL lastPathComponent] forKey:@"songName" ];
if ([songHandle propertyForKey:@"songName"] == nil) {
[bit is:YES label:@"its nil"];
}else {
[bit is:YES label:[songHandle propertyForKey:@"songName"]];
}
[songHandle addClient: self];
[songHandle loadInBackground];
}
end code
I cant retrieve the property that I have successfully set. I need to do this because I need to know which file is being downloaded, so I know what to name the file Im about to write to disk. Can anyone shed some light on this or suggest an alternative way to know what url the handle represents once URLHandleResourceDidFinishLoading?
btw: bit is:BOOL label

NSString *) is a nifty little class my friend wrote that simply pops up an alert with title. It can also be used like this:
begin code
[bit is:[songHandle writeProperty:[theSongURL lastPathComponent] forKey:@"songName" ] label:@"some label"];
end code
I tell you all this because I figured you might not know what that "bit" was all about. I use it like NSLog().