title: Error in accessing global declared NSArray values in class methods
body: <p>I have problem in fetching the element from array, </p>
  
  <p>I have declared NSArray *array globally, also tried through myfile.h file property, but I'm not able to access array element in my view controller setCode method.</p>
  
  <pre><code>        NSArray *array; 
  //this is global array also i tried in my.h file 
  //@property(nonatomic, retain) NSArra *array; 
  //and by accessing it @synthesize array; also not works for me.
  
  -(void)viewDidLoad
          {
              array = [NSArray arrayWithObjects:@"sssss", @"hjjjjj", @"kkkkkk"];
  
               [self setCode];          
          }
  
      -(void)setCode
      {
             NSString *code = [array objectAtIndex:0];
              NSLog(@"code %@",code);
      }
  
  @end
  </code></pre>
  
  <p>It throwing some errors:</p>
  
  <pre><code>2013-08-05 16:25:28.429 test_project_ios_31st_july[2409:c07] -[__NSMallocBlock__ objectAtIndex:]: unrecognized selector sent to instance 0x9c82350
  2013-08-05 16:25:28.430 test_project_ios_31st_july[2409:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSMallocBlock__ objectAtIndex:]: unrecognized selector sent to instance 0x9c82350'
  *** First throw call stack:
  (0x23fb012 0x1c98e7e 0x24864bd 0x23eabbc 0x23ea94e 0x283f 0x17594f9 0x24550c5 0x23afefa 0x168dbb2 0x16a0e6b 0xdb9f 0x16d2417 0x16ebb24 0x16a0d60 0x174da8a 0x43ac2 0x16d2417 0x16ebb24 0x16a0d60 0x174da8a 0x464d5 0x17594f9 0x24550c5 0x23afefa 0x16a0a0c 0xa3d0e6 0x206353f 0x2075014 0x20657d5 0x23a1af5 0x23a0f44 0x23a0e1b 0x2ad87e3 0x2ad8668 0xbdcffc 0x2192 0x20c5)
  libc++abi.dylib: terminate called throwing an exception
  </code></pre>