предупреждение: попытка создать переменную USE_BLOCK_IN_FRAME с блоком, который не находится в кадре

Что это значит? Я получаю эту ошибку при попытке перебрать файл в Какао obj-c.

Я не могу найти какую-либо информацию в Интернете.

Буду признателен за некоторую помощь. Спасибо.

EDIT

I» Я следовал этому руководству (ссылка) для предварительной загрузки Core Data. Я пытался создать приложение Cococa, а также пытался сделать это из моего приложения для iPhone. Я думаю, что весь мой код установки для Core Data в порядке. Всякий раз, когда вызывается этот метод, я получаю EXEC BAD ACCESS.

- (void)loadInitialData
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    // name ZSTREET_1   ZSTREET_2   ZCITY   ZZIP    ZURL    ZTEL    latitude    longitude

    NSString *path = [[NSBundle mainBundle] pathForResource:@"placesdata" ofType:@"txt"];

    NSString *fileString = [NSString stringWithContentsOfFile:path]; // reads file into memory as an NSString
    NSArray *lines = [fileString componentsSeparatedByString:@"\r"]; // each line, adjust character for line endings
    NSManagedObjectContext *context = [self managedObjectContext];
    for (NSString *line in lines)

    {   
        NSLog(line);

        NSString* string = [[NSString alloc] initWithUTF8String:line];
        NSArray *parts = [string componentsSeparatedByString:@"\t"];
        // value mapping
        NSString *name = [parts objectAtIndex:0];
        NSString *street_1 = [parts objectAtIndex:1];
        NSString *street_2 = [parts objectAtIndex:2];
        NSString *city = [parts objectAtIndex:3];
        NSString *zip = [parts objectAtIndex:4];
        NSString *url = [parts objectAtIndex:5];

        NSNumberFormatter * f = [[NSNumberFormatter alloc] init];
        [f setNumberStyle:NSNumberFormatterDecimalStyle];

        NSNumber *latitude = [f numberFromString:[parts objectAtIndex:6]];
        NSNumber *longitude = [f numberFromString:[parts objectAtIndex:7]];
        [f release];
        // splitting the parts to create the objects

        Place *place = (Place *)[NSEntityDescription insertNewObjectForEntityForName:@"Place" inManagedObjectContext:context];
        Address *address = (Address *)[NSEntityDescription insertNewObjectForEntityForName:@"Address" inManagedObjectContext:context];
        Location *location = (Location *)[NSEntityDescription insertNewObjectForEntityForName:@"Location" inManagedObjectContext:context];

        // set attributes
        [place setValue:name forKey:@"name"];
        [address setValue:street_1 forKey:@"street_1"];
        [address setValue:street_2 forKey:@"street_2"];
        [address setValue:city forKey:@"city"];
        [address setValue:zip forKey:"@zip"];
        [address setValue:url forKey:@"url"];
        [location setValue:latitude forKey:@"latitude"];
        [location setValue:longitude forKey:@"longitude"];

        // link the objects together
        [place setValue:address forKey:@"address"];
        [place setValue:location forKeyPath:@"address.location"];

        [string release];
    }
    NSLog(@"Done initial load");
    NSError *error; 
    if (![context save:&error]) {
        NSLog(@"Error saving: %@", error);
    }
    [context release];
    [pool drain];


}

21
задан Besi 3 May 2012 в 11:53
поделиться