I am getting an [NSNull rangeOfCharacterFromSet:]:
exception when attempting to display a label. The error reads
'NSInvalidArgumentException', reason: '-[NSNull length]:
Below is my code.
UILabel* spousename = [[UILabel alloc] initWithFrame:CGRectMake(10,line, 300,20)];
[spousename setText:[_thisburial objectForKey:@"Spouse"]];
I tried to test for a null character with the following code but that didn't catch the error. It blew up when trying to execute the addSuview instruction.
if(![spousename isEqual:nil])
{
[self.view addSubview:spousename];
}
So how do I test for NSNull
in a label so I can prevent from getting this [NSNull rangeOfCharacterFromSet:]:
error message?