daily pastebin goal
81%
SHARE
TWEET

Best way to make arrays

a guest Oct 16th, 2013 1,139 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (NSMutableArray*) getButtonTitles
  2. {
  3.     NSMutableArray* buttonTitles = [[NSMutableArray alloc] initWithCapacity:4];
  4.     for (NSInteger i = 0; i < (_itemCountSegmentController.selectedSegmentIndex + 1); i++)
  5.     {
  6.         switch (i) {
  7.             case 0:
  8.                 buttonTitles[0] = @"One";
  9.                 break;
  10.             case 1:
  11.                 buttonTitles[1] = @"Two";
  12.                 break;
  13.             case 2:
  14.                 buttonTitles[2] = @"Three";
  15.                 break;
  16.             case 3:
  17.                 buttonTitles[3] = @"Four";
  18.                 break;
  19.             default:
  20.                 break;
  21.         }
  22.     }
  23.     return buttonTitles;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top