Method cache corrupted. This may be a message to an invalid object, or a memory error somewhere else.

iOS 运行报错,Method cache corrupted. This may be a message to an invalid object, or a memory error somewhere else。无效的对象或者是一个内存错误。

NSInteger maxCapacity = 100;

CGPoint*refreshPoint = malloc(sizeof(CGPoint) * maxCapacity);

memset(refreshPoint,0,sizeof(CGPoint) * maxCapacity);

我的错误是因为对一个CGPoint*申请了100个数量的内存但是实际中这个使用了108个。把maxCapacity改为一个大于108的数即可

你可能感兴趣的:(Method cache corrupted. This may be a message to an invalid object, or a memory error somewhere else.)