Returns an object initialized from data in a given unarchiver.
Required.
SDKs
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
- (instancetype)initWithCoder:(NSCoder *)aDecoder;
Parameters
decoder
An unarchiver object.
Return Value
self
, initialized using the data in decoder
.
Discussion
You typically return self
from init
. If you have an advanced need that requires substituting a different object after decoding, you can do so in awake
.