error “EXC_BAD_ACCESS” in my programm

Posted by zp26 on Stack Overflow See other posts from Stack Overflow or by zp26
Published on 2010-06-03T14:43:58Z Indexed on 2010/06/03 14:54 UTC
Read the original article Hit count: 107

Filed under:
|
|

Hi, i have a problem. When i compile my program there isn't a error but, when i start it these retern with “EXC_BAD_ACCESS”. I looking for the error with the debug and i find it in these method but i don't understand where... Can you help me? Thanks and sorry for the english.

PS:the program enters in the loop sometimes.

-(void)updateMinPosition{

    float valueMinX = 150;
    float valueMinY = 150;
    float valueMinZ = 150;

    NSString *nameMinimoX = [NSString   stringWithFormat:@"default"];
    NSString *nameMinimoY = [NSString   stringWithFormat:@"default"];
    NSString *nameMinimoZ = [NSString   stringWithFormat:@"default"];

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

        //Posizione is my class. It contain a NSString name, 3 float valueX, valueY, valueZ
        Posizione *tempPosition;
        tempPosition = [[Posizione alloc]init];

        tempPosition = [arrayPosizioniMovimento objectAtIndex:i];

        if(tempPosition.valueX <= valueMinX){
            valueMinX = tempPosition.valueX;
            nameMinimoX = tempPosition.nome;
        }

        if(tempPosition.valueY <= valueMinY){
            valueMinY = tempPosition.valueY;
            nameMinimoY = tempPosition.nome;
        }

        if(tempPosition.valueZ <= valueMinZ){
            valueMinZ = tempPosition.valueZ;
            nameMinimoZ = tempPosition.nome;
        }

        [tempPosition dealloc];
    }

    labelMinX.text = nameMinimoX;
    labelMinY.text = nameMinimoY;
    labelMinZ.text = nameMinimoZ;   
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c