Reputation: 936
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]]]];
}
Upvotes: 3
Views: 1835
Reputation: 936
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
Upvotes: 0
Reputation: 8131
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.
Upvotes: 1