Help needed to assign the value of an object of array to a variable

Posted by user594861 on Stack Overflow See other posts from Stack Overflow or by user594861
Published on 2011-02-03T07:02:03Z Indexed on 2011/02/03 7:25 UTC
Read the original article Hit count: 135

Filed under:
|

Hi All, This is my code:

int random=0;
int counter=0;
while(counter<25)
{   
    random=arc4random() % 40;
    BOOL flag=[array containsObject:[NSNumber numberWithInt:random] ];
    if(flag)
    {   
        counter--;
    }
    else
    {       
        [array addObject:[NSNumber numberWithInt:random]];
        int p=[array objectAtIndex:counter];    //**line4
        counter++;
    }   
}

getting a warning on line 4, not able to assign the value of an object of an array to a variable, please help me Thanks

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c