Unable to delete files from mainBundle

I'm having trouble deleting files from my main package. When I delete them manually from support files in XCODE 4.2. They still appear when I launch the application. I opened the application file with “displaying the contents of the package” and manually deleted them from there, and they are still displayed when the application starts. I deleted the application from the simulator and from the ~ / applications folder in the library, and the same behavior exists. Did I miss something?

Reference Information. I have a helper application in which I can drop the files into the “support files” folder and run them to convert them from KML to custom XML for use in another application by downloading the server to the device. I create an array of file names from the main package with the code below and pass it to the parser. I have problems because it includes deleted / deleted files from the package and I cannot understand why. Any help would be appreciated.

-(NSArray*)findKMLFilesInMainBundle{
NSString *path = [[NSBundle mainBundle]resourcePath];
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error = [[NSError alloc]init];
NSMutableArray *kmlArray = [[NSMutableArray alloc]initWithCapacity:10];

NSArray *files = [fileManager contentsOfDirectoryAtPath:path error:&error];
unichar buffer[5];

//now seach for the kml files
for (NSString *fileName in files){
    NSLog(@"%@",fileName);
    int count = [fileName length];
    int start = count - 3;
    NSRange range = {start,3};


    [fileName getCharacters:buffer range:range];
    NSString *endString = [NSString stringWithCharacters:buffer length:3];
    if ([endString isEqualToString:@"kml"]){
        NSString *kmlFileName = [fileName stringByDeletingPathExtension];
        NSLog(@"kmlFilename%@",kmlFileName);
        [kmlArray addObject:kmlFileName];

    }
}
for (NSString *name in kmlArray){
    NSLog(@"file = %@",name);
}

return kmlArray;

}

+1
source share
1 answer

Hold ⌥ Optionand select Product → Empty build folder ... from the menu bar. The default shortcut for this action is ⌥⇧⌘K.

+10

Source: https://habr.com/ru/post/1765742/


All Articles