For the most part, you don't have to implement Key-Value Coding. Instead, you create your classes to comply with various conventions and then Key-Value Coding works for it automatically.
The conventions are about how you name methods in order to make a property accessible via KVC.
Your code:
univ=[[Universal alloc] init];
[univ setValue:univ.datamember1 forKey:@"1"];
[univ setValue:univ.datamember2 forKey:@"2"];
[univ setValue:univ.datamember3 forKey:@"3"];
[univ setValue:univ.datamember4 forKey:@"4"];
[univ setValue:univ.datamember5 forKey:@"5"];
is strange. What are you trying to do here? This code looks like it's trying to set properties on the univ object from other properties of the univ object. That would be redundant.
I suspect you think that you're establishing synonyms or aliases here – that you're making key "1" map to the property datamember1. That's not correct. The -setValue:forKey: method is for actually setting a property's value. It's very much like calling a setter method; in fact, it usually does result in calling a setter method.
So, what you've written is very much like the following:
univ=[[Universal alloc] init];
[univ set1:univ.datamember1];
[univ set2:univ.datamember2];
[univ set3:univ.datamember3];
[univ set4:univ.datamember4];
[univ set5:univ.datamember5];
I doubt that's anything that you meant to do. It might help you to explain what you're trying to do in non-KVC terms. What properties are you trying change (if you are)? What values would you like to assign to them? How would you do that using just ordinary setters and getters?
Later, you posted this code:
id temp1=[univ valueForKey:@"1"];
temp1=strVal;
[resultArray addObject:univ];
Again, this is strange and confusing. I suspect you're trying to change a property value on univ, but that's not what that code accomplishes, even if it could be made to work. The first line attempts to get the value of a property of the univ object, where the property's name is "1". That's not a valid name for a property. Anyway, it stores the retrieved value into a local variable temp1. The second line simply throws away the result of the first line and stores a different value into the local temp1 variable. The temp1 variable is independent of the univ object, even though a moment ago it was storing a result retrieved from the univ object. Changing temp1 can't change univ (although messaging the object pointed to by temp1 could change that object and it might also be pointed to by univ).
It seems to me that you aren't yet ready to be using Key-Value Coding. You need a better understanding of the basics. Also, it's almost never necessary to use Key-Value Coding with a static, known-at-compile-time key. Key-Value Coding is for dynamic access to properties of an object when you don't know the name of that property at compile time but you'll have the name as data at run time.