Crash loading TPK file

721
1
06-14-2012 06:06 PM
ThaneMorgan
New Contributor
I'm loading a TPK file which crashes in the method [AGSZipFile initWithFileName:mode:]. The crash is 4 methods into the method called by my code [AGSLocalTiledLayer localTiledLayerWithPath:locallayerpath].

The TPK loads OK in a Flex app but not in the SDK. I've unzipped successfully so it doesn't appear to be a corruption problem. Here's the section of code that I'm using:


    // Local aerial photography
    NSString *locallayerpath = [[NSBundle mainBundle] pathForResource:@"ClarksvilleAerials2010" ofType:@"tpk"];
    AGSLocalTiledLayer* localtiledlayer = [AGSLocalTiledLayer localTiledLayerWithPath:locallayerpath];
    if (localtiledlayer != Nil)
    {
        [self.mapView addMapLayer:localtiledlayer withName:@"Local Tiled Layer"];
    }
0 Kudos
1 Reply
ThaneMorgan
New Contributor
It turns out the problem was the TPK file size, 4.3 GB. The Mac OS acts like the file has been moved but is still copying it in the background. You have to move slowly and make sure the data has really been moved. Trying to access it to before hand seems to break the transfer process.
0 Kudos