I am struggling to find a shorthand version of the code shown below. Basically I am saving Events into core data. Each event has up to 15 contacts. newEvent is from an Event class.
The code below works great, but I don't want to have it duplicated 15 times for each contact. Is there an easier way?
if ([[selectedContacts objectAtIndex:14] objectAtIndex:0] != (id)[NSNull null]) {
newEvent.contact15 = [[selectedContacts objectAtIndex:14] objectAtIndex:0];
}
else {
newEvent.contact15 = @"";
}
contactXfields to be a single array and loop through it.