Question

I have a three asset folders set up, one called Images which have the app icon and launch images in, one called Puzzles and one called ThumbPuzzle.

When testing on the simulator, the images all load fine, when testing on the device, the images don't load and the following error appears in the console.

mmap: Cannot allocate memory

Error: CUICommonAssetStorage -initWithPath: No storage file found at /var/mobile/Applications/6DF65069-9ED2-4EE8-966A-5B63CBF36136/Puzzle Mania.app/Assets.car

I know the images are named correctly, since i copied their names from the catalog. I'm loading the images using the following

- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    pm_PuzzleCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];
    PM_Puzzle *puzzle = [self.frcPuzzles objectAtIndexPath:indexPath];
    cell.puzzle = puzzle;
    return cell;
}

and the following in the pm_PuzzleCell

-(void) setPuzzle:(PM_Puzzle *)puzzle
{
    if(_puzzle != puzzle) {
        _puzzle = puzzle;
    }
    [self.imageView setImage:[UIImage imageNamed:[NSString stringWithFormat:@"Thumb%@", [puzzle puzzleImage]]]];
}
Was it helpful?

Solution 2

The problem is avoided by importing the resources into the project, then importing them into the asset catalog. Importing them straight into the catalog didn't work

OTHER TIPS

Probably the xcassets is too big.
Or better, the images in the xcassets are too big and xcode wan't load.

mmap: Cannot allocate memory

I removed xcasset moving images in Resource folder and works well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top