2

if I do

zPosition = 3;

and then right away I run a method that does

string = [[NSString alloc]initWithFormat:@"%i", (NSInteger)shape.zPosition];'
label.text = string;'

then the label displays an incorrect value for the zPosition. however if I run my method after a delay then it works.

what's going on there? does zPosition take a moment to kick in? or am I just doing something the wrong way?

here's a gist example of what I'm talking about https://gist.github.com/4670390

Greg Debicki
  • 235
  • 2
  • 6

1 Answers1

1

Unfortunately, YES, it takes a split second.

The answer as to "why" this is happening, is that the animation duration was implicitly being set to 0.0001 seconds in the api. Your immediate call to [self updateLabels] was actually being called before the zPosition properties were finished animating.

This is actually a bug I've now tracked in C4, I've fixed it in the full project that's available on github but it will be a while before this makes it into the installer / project template.

C4 - Travis
  • 4,502
  • 4
  • 31
  • 56