0
我有這樣的代碼:爲什麼使用subdataWithRange崩潰會導致部分數據範圍?
NSMutableData *derivedKey = [NSMutableData dataWithLength:32];
// code missing..fill somehow the derivedKey with 32 random bytes
// This line doesn't crash
NSData *iv = [derivedKey subdataWithRange:NSMakeRange(0, 32)];
..
// This line crashes
NSData *iv = [derivedKey subdataWithRange:NSMakeRange(16, 32)];
任何建議,爲什麼出現這種情況? 似乎以某種方式只能從0的整個範圍 - 32穿過 我想簡單一個新的NSData變量僅包含字節
Oh..I與位置混淆了。非常感謝你 –