Global nomad
Global nomad

Reputation: 1022

If I use Objective C 2.0's @synthesize, does that mean my model class is KVC compliant (including validation)?

1) Or do I still need to implement to validation methods described in the KVC guide? and 2) do I need to override the setNilValueForKey: and similar methods?

Thanks.

Upvotes: 1

Views: 128

Answers (2)

PeyloW
PeyloW

Reputation: 36752

It is KVO compliant if you use @synthesize.

But it will not have any validation. The run-time can not make any guess on how you want to validate your data. So nil values etc. will be allowed. Validation is up to you.

Upvotes: 2

Joris
Joris

Reputation: 6305

What do you mean by "including validation"?

But indeed, your class is KVC compliant for the properties you declare as such

Upvotes: 1

Related Questions