【iOS】AMPathPopUpButton
来源:互联网 发布:linux shell wait命令 编辑:程序博客网 时间:2024/06/11 15:15
在Mac OS开发中,我们可以使用AMPathPopUpButton控件来实现用户选择文件夹路径的功能,非常方便实用。
步骤一、首先我们需要在项目工程中添加Automator.framework系统库文件。在ViewController.h文件中,使用@class 向前引用AMPathPopUpButton类。
步骤二、打开Main.storyboard,在Show the Object library面板中选中Automator Path Pop Up Button 控件,并将其拖入到故事版中:
步骤三、在Show the Attributes inspector中可以对AMPathPopUpButton控件的属性进行设置。Path Types分为:Applications(应用)、Directories(目录)、Files(文件)这三种类型,Choosen 设置控件显示的是New Paths(新地址)还是Existing Paths(已存在的地址),Show 一般选择 Standard Paths即可。
步骤四、运行效果:
步骤五、获取AMPathPopUpButton控件选中的路径地址以及为其设置新的地址:
首先需要打开Show the Bindings inspector,勾线Bind to 并选中对应的ViewController,设置Model Key Path 为self.mPath(自定义值)。然后在ViewController.h文件中为其添加@property(nonatomic,copy)NSString*mPath;
通过mPath即可获取AMPathPopUpButton当前选中的路径地址,也可以将新的地址赋值给mPath对AMPathPopUpButton进行新地址设置。
- 【iOS】AMPathPopUpButton
- iOS
- iOS
- IOS
- iOS
- iOS
- IOS
- ios
- iOS
- iOS
- IOS
- iOS
- ios
- ios ~~~~~
- ios
- IOS
- IOS
- IOS
- Tkinker之Button篇
- react-native 使用vector-icons图标库
- PHP实现长网址与短网址
- 秋招在线笔试总结--830
- 单例模式
- 【iOS】AMPathPopUpButton
- tips :idea 没有tomcat了,怎么配置下
- JavaScript内存泄漏浅析
- MySQL 批量导入sql文件
- tomcat+java的web程序持续占cpu问题调试
- 移动端常见的一些问题(版权归妙味所有,仅搬运转载)
- R语言识别ORACLE数据库名
- 欢迎使用CSDN-markdown编辑器
- iOS 兄弟控件的 自动布局实现N等分且宽高比例是1:N(xib 上实现) 代码很简单就不多说