I have a Delegate class that processes responses from CLLocationManager and prints them through printf (). Is there any type of busy cycle I can add to main () so that the program stays open and supports the CLLocationManager associated with the delegate, happily handling events?
#import <Foundation/Foundation.h>
#import "Delegate.h"
#import <CoreLocation/CoreLocation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Delegate *del = [Delegate alloc];
CLLocationManager *locationManager;
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = del;
[locationManager startUpdatingLocation];
[pool drain];
return 0;
}
source
share