NNikN
NNikN

Reputation: 3850

NSKeyedArchiver init not called

I used the following code and it throws an error [NSKeyedArchiver init]: cannot use -init for initialization

Code:-

NSKeyedArchiver *a=[[NSKeyedArchiver alloc] init];

Upvotes: 0

Views: 204

Answers (1)

rdelmar
rdelmar

Reputation: 104082

That's because the NSKeyedArchiver class doesn't have "plain vanilla" init method. you have to use initForWritingWithMutableData:

Upvotes: 2

Related Questions