Tuesday 15 July 2014

objective c - Any way to see who is triggering changes re: key value observing? -


I am using a key value to perform special tasks while changing certain properties (e.g., the custom UIView's relay Subvuctions change its frame or boundary whenever it is ever) Is there any way to see that (ie, the function) is triggering this change? My Inspection Validate: Object of: Change: Reference: does not help because I do not think I can see who caused a change in Frame or Edit

Edit

In my specific example, I did not know who / what is changing the dimensions of my UIView. 1: Screenshot of my stack trace, paused when the frame / border is called within the inspection value ...

Also keep in mind that it is only for debugging purposes is.

stack trace

In general, no, in addition to looking at the stack trace, you do not know how KVC mutation (and therefore the KVO notification) could be the reason. In this case, - [UIView (geometry) _applyAutoresizingMaskWithOldSuperviewSize] appears to be a criminal, but more commonly it seems that the process of triggering the notification is the process of inconsistent and carrying out. Since this change has not come from your code, I'm not sure how it will know where it came from.

There are some tips that over your code of observation on the "Knowledge" stack above your code above the heap. You can hide a flag / value in the [[NSThread currentThread] threadDictionary] and then check in your supervisor method (remember that the flag is clearly removed before stack frame returns Let's do this), and on top of it, it will not give you any information about such cases, where your code is not directly triggering the change.

No comments:

Post a Comment