in Technology by

What is KVC and KVO? Give an example of using KVC to set value.

1 Answer

0 votes
by

Key-Value-Coding (KVC) means accessing a property or value using a string. id someValue = [myObject valueForKeyPath:@”foo.bar.baz”];

Which could be the same as:

id someValue = [[[myObject foo] bar] baz];

Key-Value-Observing (KVO) allows you to observe changes to a property or value.

To observe a property using KVO you would identify to property with a string; i.e., using KVC. Therefore, the observable object must be KVC compliant.

[myObject addObserver:self forKeyPath:@”foo.bar.baz” options:0 context:NULL];

Related questions

0 votes
    Give an example for step definition using “Given” function?...
asked Nov 16, 2020 in Technology by JackTerrance
0 votes
    When I've registered an object foo to receive KVO notifications from another object bar (using addObserver:. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
0 votes
    What is a Parameter in Tableau? Give an Example....
asked Mar 30, 2021 in Technology by JackTerrance
0 votes
    Give an example of a behavior is driven test in plain text Cucumber?...
asked Nov 16, 2020 in Technology by JackTerrance
0 votes
    Give one example each of ( a ) α − ( emission, ( b ) β c − − ( emission, and ( c ) K − ... Write an equation for these nuclear changes. Select the correct answer from above options...
asked Jan 2, 2022 in Education by JackTerrance
0 votes
    Give an example of a project you have worked on and the technologies involved. How did you make these choices?...
asked Jun 13, 2021 in Education by Editorial Staff
0 votes
    What are emulsions ? What are their different types ? Give an example of each type ? Select the correct answer from above options...
asked Jan 3, 2022 in Education by JackTerrance
0 votes
    What are micelles ? Give an example of a micelle system. Select the correct answer from above options...
asked Jan 2, 2022 in Education by JackTerrance
0 votes
    What is meant by a fissiionable isotope? How are such isotopes produced artifically ? Give an example. Select the correct answer from above options...
asked Jan 2, 2022 in Education by JackTerrance
0 votes
    What do you understand by tracers ? Give an example of a tracer that can be used in determining the mechanism of a chemical reaction. Select the correct answer from above options...
asked Jan 2, 2022 in Education by JackTerrance
0 votes
    Answer the following questions: 1. What is data type? Give an example. 2. What is the difference between 19/6 & 19/60. ... a++ & a+ =1. Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    Give one example of an application which uses augmented reality. Select the correct answer from ... by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 12, 2021 in Education by JackTerrance
0 votes
    What is Natural Language Processing? Give an example of it. Select the correct answer from above options...
asked Nov 12, 2021 in Education by JackTerrance
...