tags:

views:

39

answers:

0

I have a function which have two global variable 1.temp-a nsmutable array 2.j-a int type variable. But i cant access any global variable inside this function. I'm giving the code sample.

void print( NSArray *array) 
{ 
    NSEnumerator *enumerator = [array objectEnumerator]; 
    id obj;
    while ( nil!=(obj = [enumerator nextObject]) )
    {   
   NSString *tem=[[obj description] cString];   
   [temp insertObject:tem atIndex:j];
   j=j+1;
        printf( "%s\n", [[obj description] cString]); 
    }
}

What should i do to resolve that problem.Looking forward to your response. Thanks in advance..