I have a function, markCompare, which calls another, markDuration, to get a double which it assigns to the variable duration1.
static int markCompare(Mark *mark1, Mark *mark2) {
...
/**/NSLog(@"markCompare calls markDuration...");
double duration1 = markDuration(mark1);
/**/NSLog(@"...which returns a value %0.2f which markCompare assigns to duration1", duration1);
...
}
double markDuration(Mark *mark) {
...
/**/ NSLog(@"markDuration returning duration = %0.2f", duration);
return duration;
} //end markDuration
As you can see from the following NSLogs, markDuration returns 0.25, but markCompare receives the value 0.00 from it, which it assigns to duration1.
2008-03-23 18:53:13.889 AttonalComposer[6227:813] markCompare calls markDuration...
2008-03-23 18:53:21.101 AttonalComposer[6227:813] markDuration returning duration = 0.25
2008-03-23 18:53:26.591 AttonalComposer[6227:813] ...which returns a value 0.00 which markCompare assigns to duration1
Is this a bug in my code -- or in Xcode?