NSKeyedArchiver and NSKeyedUnarchiver with NSMutableArray

前端 未结 4 1114
别那么骄傲
别那么骄傲 2021-02-04 18:05

I\'m hoping this isn\'t something to do with the fact that I\'m using a Mutable array here, but this one is baffling me so it wouldn\'t surprise me if that were the case.

<
4条回答
  •  逝去的感伤
    2021-02-04 18:50

    Sounds like a memory management issue to me. EXC_BAD_ACCESS usually means that you're trying to access an object that has been deallocated. unarchiveObjectWithFile: returns an autoreleased object, so you have to retain it if you want to keep it around, either with an explicit retain or by assigning it to a retained property.

提交回复
热议问题