Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 4th, 2012  |  syntax: Objective C  |  size: 0.63 KB  |  hits: 39  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. void logNumbers() {
  2.     int start = 1, end = 10;
  3.     for (int index = start; index <= end; index++) {
  4.         NSLog(@"%d", index);
  5.     }
  6. }
  7.  
  8. void logAlphabets() {
  9.     int start = 65, end = 90;
  10.     for (int index = start; index <= end; index++) {
  11.         NSLog(@"%c", index);
  12.     }
  13. }
  14.  
  15. -(void) viewDidAppear:(BOOL)animated {
  16.     [super viewDidAppear:animated];
  17.    
  18.     dispatch_queue_t aQueue;
  19.    
  20.     // Get the global concurrent queue.
  21.     aQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
  22.    
  23.     dispatch_async_f(aQueue, NULL, logNumbers);
  24.     dispatch_async_f(aQueue, NULL, logAlphabets);
  25. }