how to set NSArray values to UILabel

If i am getting your question right, you want to do this —
Firstly make a global NSInteger variable and assign it as 0 in viewDidLoad(). (i.e. currentIndex = 0). And use this

 -(IBAction)btnClicked:(id)sender 
 {
    currentIndex = currentIndex + 1;  
    if(currentIndex >[fetchedobj count]-1 )
          currentIndex = 0;  

    // here set your values  
   n1.text=[[fetchedobj objectAtIndex: currentIndex]valueForKey:@"tag"];
   -----
   -----
 }

Leave a Comment