I have a binary data attribute in Core Data that depending on a situation gets assigned a value (its actually a voice recording) or not.
I need to be able to test whether its been set or not like a bool value. How would I do that?
This code works for the other objects (int values in core data) but obviously not for a Binary Data attribute.
aud开发者_如何学PythonioRecorded.text = [[[tests objectAtIndex:t] valueForKey:@"test_voice"] boolValue] ? @"YES" : @"NO";
Ok figured it out - dead simple...realised I'm actually testing if it exists anyway duh!
audioRecorded.text = [[tests objectAtIndex:t] valueForKey:@"test_voice"] ? @"YES" : @"NO";
No need to cast it as a boolValue.
精彩评论