我有一個三個資產文件夾設置,一個叫圖像,其中有應用程序圖標和啓動圖像,一個叫拼圖和一個叫ThumbPuzzle。資產目錄,圖像沒有加載在設備上,但罰款在模擬器
在模擬器上進行測試時,圖像全部正常加載,在設備上進行測試時,圖像無法加載,並且控制檯中出現以下錯誤。
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
我知道圖像命名正確,因爲我從目錄中複製了它們的名稱。我使用以下
- (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;
}
加載圖像,並在pm_PuzzleCell
-(void) setPuzzle:(PM_Puzzle *)puzzle
{
if(_puzzle != puzzle) {
_puzzle = puzzle;
}
[self.imageView setImage:[UIImage imageNamed:[NSString stringWithFormat:@"Thumb%@", [puzzle puzzleImage]]]];
}
你解決了嗎? – elp