So I have a method that's something like this:
-(BOOL)isSingleValueRecord
And another method like this:
-(Type)typeOfSingleValueRecord
And it occurred to me that I could combine them into something like this:
-(id)isSingleValueRecord
And have the implementation be something like this:
-(id)isSingleValueRecord {
//If it is single value
if(self.recordValue = 0) {
//Do some stuff to determine type, then return it
return typeOfSingleValueRecord;
}
//If its not single value
else {
//Return "NO"
return [NSNumber numberWithBool:NO];
}
}
So combining the two methods makes it more efficient but makes the readability go down. In my gut, I feel like I should go with the two-method version, but is that really right? Is there any case that I should go with the combined version?