问题描述
- 从NSMutableData中移除字节
-
NSMutableData对象中移除最末六位的字节,对象如下:NSMutableData *reducedDataPacket = [[NSMutableData alloc] init]; reducedDataPacket = [myCompressedData copy]; NSRange range = NSMakeRange([reducedDataPacket length]-6, 6); [reducedDataPacket replaceBytesInRange:range withBytes:NULL length:0];
但是执行会引发崩溃:
-[NSConcreteData replaceBytesInRange:withBytes:length:]: unrecognized selector sent to instance 0x1f037870 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteData replaceBytesInRange:withBytes:length:]: unrecognized selector sent to instance 0x1f037870
感谢您的回答!
解决方案
你好 请问您这个问题解决了没有?因为我现在也遇到一样的问题,不知道怎么调试,请帮忙提示下 谢谢。
时间: 2024-10-31 10:13:58