I’m making an app that needs to present the user with a way to choose an output directory. At present, I’ve got an AMPathPopUpButton in my view, which looks great. But, no matter what I try, I can’t get the path from it.
What I’ve tried so far:
- Binding the AMPathPopUpButton’s path value to an object controller using the controller key “selection” and the model key path savePath, which shows the message “Xcode cannot resolve the entered keypath, even though the key is added to the object controller. The object controller is then bound to a dictionary in an instance of the class in which I need to use the value. The dictionary is initialized in
-(void)awakeFromNib.- Result: null value returned from
[filePathDict objectForKey:@"savePath"]
- Result: null value returned from
- Binding the AMPathPopUpButton’s path value straight to a string in an instance of the class, which is also initialized in
-(void)awakeFromNib.- Result: the app spits out
-[AMPathPopUpButton hasVariableForm]: unrecognized selector sent to instance 0x10050e1b0on startup and crashes.
- Result: the app spits out
- Connecting the AMPathPopUpButton to an instance of the class with an outlet
- Result: There is no definition of AMPathPopUpButton anywhere in Automator.framework, so I get the error
Unknown type name 'AMPathPopUpButton'
- Result: There is no definition of AMPathPopUpButton anywhere in Automator.framework, so I get the error
I’ve got no idea what to try next. I’m sure the fact that I can’t get the bindings working is something fundamental (I haven’t used bindings before except together with the Shared User Defaults Controller, and then only for a textfield and a color well :p)
Does anyone know what I’m doing wrong?
I just ended up using an NSPathControl. Doesn’t look quite as nice, but it works :p