Hal
Hal

Reputation:

UIAlert erroneous behaviour

// Tratamento de eventos: caso o utilizador clique numa das células da tabela Hello again guys, I was trying to display a UIAlertView to show the summary of a 'Movie' object i have stored and my idea was to show two buttons in it if i had the movie's website stored, or just to show one if the movie didn't have one.

Oddly enough, i'm getting not one, not two, but 3 very different UIAlertViews!

alt text

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    NSString *ShinraTensei = (@"%@ \n", [[array_resultados objectAtIndex:indexPath.row] Sumario]);

    if([[array_resultados objectAtIndex:indexPath.row] WebSite] != nil)
    {
    //  NSLog(@"Nulo");
        UIAlertView* myAlertView = [[UIAlertView alloc] initWithTitle:[[array_resultados objectAtIndex:indexPath.row] TituloFilme] message:ShinraTensei delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];

        CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 0.0);
        [myAlertView setTransform:myTransform];
        [myAlertView show];
        [myAlertView release];
            myAlertView = nil;
    }
    else
    {
        UIAlertView* myAlertView2 = [[UIAlertView alloc] initWithTitle:[[array_resultados objectAtIndex:indexPath.row] TituloFilme] message:ShinraTensei delegate:self cancelButtonTitle:@"LOL" otherButtonTitles:nil];

        CGAffineTransform myTransform2 = CGAffineTransformMakeTranslation(0.0, 0.0);
        [myAlertView2 setTransform:myTransform2];

        [myAlertView2 show];
        [myAlertView2 release];
            myAlertView = nil;
    }
}

EDIT: If you can't see the picture embeded in this post, please visit: http://i41.tinypic.com/2vc9hg9.jpg

Upvotes: 2

Views: 1993

Answers (4)

Lily Ballard
Lily Ballard

Reputation: 185681

The first dialog is the standard UIAlertView. The second I can only guess, but I would assume it's when you have too much message text, and it looks different to signal the user that they can scroll the message. The third is UIAlertView with just a title and no message at all.

Upvotes: 1

Brad The App Guy
Brad The App Guy

Reputation: 16275

It looks like the logic here is good. Youi are most likely having a problem with your data model.

I'm guessing that the value of [[array_resultados objectAtIndex:indexPath.row] TituloFilme] message:ShinraTensei] is nil, in the cases where you are seeing the third type of dialog.

Upvotes: 0

rustyshelf
rustyshelf

Reputation: 45101

So what is your actual question? I love screenshots as much as the next person, but I don't see a question anywhere?

Upvotes: 0

Hal
Hal

Reputation:

Can you see the pic? It's here if you can't: http://i41.tinypic.com/2vc9hg9.jpg

Upvotes: 0

Related Questions