辞書を使ったゲームを作りました。約73000語あります。ただし、審査プロセスの後、アプリは拒否されました。以下、レビューコメントです。
「iOS 6.1.3 を実行している iPad でアプリがクラッシュすることがわかりました」「再生ボタンをタップするとアプリがクラッシュします。」「アプリがメモリを使いすぎると、この問題が発生する可能性があります。」
私は困惑しています。6.1.3 を実行している iPhone または 6.1.3 を実行している iPad のアプリでは問題ありません。したがって、iPad miniでクラッシュしたと想定しています。辞書をメモリにロードするためのより効率的な方法/より良い場所はありますか? これは、再生ボタンが押された後に現在行っている方法です。前もって感謝します!
NSString *filePath = [[NSBundle mainBundle] pathForResource: [NSString stringWithFormat: @"dictionary"] ofType:@"txt"]; //set where to get the dictionary from
NSData* data = [NSData dataWithContentsOfFile:filePath]; //pull the content from the file into memory
NSString* string = [[[NSString alloc] initWithBytes:[data bytes]
length:[data length]
encoding:NSUTF8StringEncoding] autorelease];//convert the bytes from the file into a string
NSString* delimiter = @"\n";//split the string around newline characters to create an array
currentDict = [string componentsSeparatedByString:delimiter];
[currentDict retain];