Guest User

Untitled

a guest
Jul 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #import <objc/objc.h>
  2. #import <Foundation/Foundation.h>
  3. #import <objc/NSArray.h>
  4.  
  5.  
  6. int main ( int argc, char ** argv)
  7. {
  8. int ar[100] = {0};
  9. int i;
  10. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  11. NSArray *arr = [[NSArray alloc] initWithObjects:@"stackOverflow", @"1", @"2", nil];
  12. NSLog (@ "Counts in the array %i", [arr count]);
  13.  
  14. @try {
  15. NSString *str;
  16. str = [arr objectAtIndex:1];
  17. NSLog (@" String value is %@ ", str);
  18. }
  19. @catch (NSRangeException * excep)
  20. {
  21. NSLog (@"Reached Range caught for %@:%@" [excep name], [excep reason]);
  22. }
  23.  
  24. [pool release];
  25. }
Add Comment
Please, Sign In to add comment