tags:

views:

73

answers:

0

Ok this one drives me crazy...

I make a connection with some url, parsing the xml and returning a url for some image...

The thing is that when I try to set the image for display (both with bindings and object messaging) through connectionDidFinishLoading method... nothing happens!!!

Please note that when I try to set the image through awakefromnib method everything works like a charm!

here is some code...

This one works...

    -(void)awakeFromNib
{
    [detailImageNew setImage:nil imageProperties:nil];
    [self setBindUrl:[NSURL URLWithString:@"http://www.someurl.com/image.jpg"]];
}

This one doesn't work...

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    //detailImageNew.backgroundColor = [NSColor redColor];
    NSError *error;
    NSXMLDocument *document =
    [[NSXMLDocument alloc] initWithData:responseForLarge options:NSXMLDocumentTidyHTML error:&error];

    NSXMLElement *rootNode = [document rootElement];

    NSString *xpathQueryImageDetailsLarge =
    @".//div[@class='thumb_image_container']/a/img/string(@src)";
    NSArray *largetmb = [rootNode objectsForXQuery:xpathQueryImageDetailsLarge error:&error];

    NSLog(@"%@",[largetmb objectAtIndex:0]);

    NSURL *imageUrl = [NSURL URLWithString:[largetmb objectAtIndex:0]];


    [self setBindUrl:imageUrl];

(through debugging I see that bindUrl, a NSURL object, is getting the value just fine... but nothing happens in the UI)

Any help guys would be precious...