代码之家  ›  专栏  ›  技术社区  ›  William Entriken

在clicocoa应用程序中,如何实现事件循环?

  •  3
  • William Entriken  · 技术社区  · 14 年前

    #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];
    
        // Something goes here
    
        [pool drain];
        return 0;
    }
    
    1 回复  |  直到 14 年前
        1
  •  2
  •   Peter Hosey    14 年前

    这就是NSRunLoop的用途 CLLocationManager