cocoa - Changing the value of an NSImageView when it is edited via the control -


I have an NSImageView that is editable when the user deletes the image, then I go back to a default image I would like to be able to change the value that the NSImageView is bound in the setter, but the recipient is not called later, so the NSImageView is empty, despite being set to another image. Here is the setter code:

  - (zero) setCurrentDeviceIcon: (NSImage *) newIcon {[Will Will Changewellfall: @ "Current Device Icon"]; If (newIcon == zero) newIcon = [currentDevice defaultHeadsetIcon]; CurrentDeviceIcon = newIcon; [Self setvideo chained med: yes]; [AUTO KEYCHENGEVALFORKIKI: @ "Current DeviceIcon"]; }  

How do I update NSImageView's value to it?

Editing (Binding Image):

No need to send messages inside send and didChangeValueForKey: , when a person sees your currentDeviceIcon property, the KVO automation Wrap your setter method to post those notifications, when someone sends a setCurrentDeviceIcon: message to your object.

, the method should look like this:

  - (zero) the current device icon set: (NSImage *) newIcon {if (newIcon == zero) newIcon = [ CurrentDevice defaultHeadsetIcon]; CurrentDeviceIcon = newIcon; [Self setvideo chained med: yes]; }  

And then you need to send this object to setCurrentDeviceIcon: to change the value of the property. Exclude this method, do not specify the init or dealloc (later in two, you should generally) specify the currentDeviceIcon frequency variable of your Do not send any other message to you)

If it is not working for you, then your image view is not bound, or it is bound to the wrong object. How are you binding it? Can you post a binding inspector code / a screenshot?


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -