r/simpleios • u/john_alan • Apr 14 '13
NSArray magically turned into NSDictionary
So, I was messing around with JSON tonight, and I have a Json parser, which fetches info and brings it back, I assign this info into an NSArray. I kept crashing out and after debugging I find the the NSArray variable that I have defined, is actually an NSDictionary instance, how can this happen? Does it automatically change depending on what's assigned into it?
5
Upvotes
View all comments
Show parent comment
2
u/phughes Apr 15 '13
Run this code in the same place and it may help you to understand what's going on:
You will see that the green subview is visible (and completely covering) the red subview from the instant this code is called.
If you were to change the last part to:
You'll see the red view slowly fade out and uncover the red subview.
The thing about completion blocks that you have to understand is that they run after the delay, while the next method call after your call to animateWithDuration: runs before the animation begins.
To fix this problem you'll probably have to change your code to something like this: