1,字符串加@:

不加@的是C语言字符串。

加@的代表的是OC的NSString

http://www.jikexueyuan.com/course/71_2.html

2,setValuesForKeysWithDictionary

http://www.cnblogs.com/YouXianMing/p/3641304.html

3,instancetype只能作为返回值,不能像id那样作为参数。

4,UIActionSheet

- (IBAction)showSheet:(id)sender {
UIActionSheet *actionSheet = [[UIActionSheet alloc]
initWithTitle:@"title,nil时不显示"
delegate:self
cancelButtonTitle:@"取消"
destructiveButtonTitle:@"确定"
otherButtonTitles:@"第一项", @"第二项",nil];
actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[actionSheet showInView:self.view];
}

转成Swift 

直接调用ActionSheet的 init(title: String?, delegate: UIActionSheetDelegate?, cancelButtonTitle: String?, destructiveButtonTitle: String?)

方法不行。必须 分开写才行。

actionSheet = UIActionSheet()

actionSheet.title =   Str_label_goods_category

actionSheet.delegate = self

for (var k = 0 ;k < str.count ; k++ )

{

actionSheet.addButtonWithTitle(str[k])

}

actionSheet.actionSheetStyle  =  UIActionSheetStyle.BlackOpaque

actionSheet.showInView(self)

5,oc 的文件导入swift项目中

如果OC的代码非arc的,需要在compile source  里面给该文件更改Compiler Flags为-fno-objc-arc

arc的不需要。

然后在supporting Files里面的jj-Bridging-Header.h里面加入#import<*****.h> (#include"***.h"也行)

6,oc项目调用swift

oc头部引用#import"项目名-swift.h"

最新文章

  1. css learn
  2. PHP Yii1.1.13(一):命令行创建应用~shop
  3. Canopy使用教程 (2)
  4. SNMP: Simple? Network Management Protocol(转)
  5. Cocos2d-x 3.x 头像选择,本地相册图片+图片编辑(Android、IOS双平台)
  6. 转:C++ 匿名namespace的作用以及它与static的区别
  7. 利用Struts拦截器限制上传图片的格式和大小
  8. 具体解释Java虚拟机类载入
  9. VScode离线安装插件
  10. Python【第三篇】文件操作、字符编码
  11. [IIS]win7下怎么安装IIS
  12. 高负载集群实战之lvs负载均衡-技术流ken
  13. Python之推导式、生成器表达式
  14. C# Serializable
  15. nodejs+react使用webpack打包时控制台报错
  16. Global配置接口访问日志以及测试日志记录
  17. Cordova 问题点备忘
  18. 2018-2019-20172329 《Java软件结构与数据结构》第八周学习总结
  19. 序列化 json和pickle
  20. Python语言库pyttsx3

热门文章

  1. Android -- 自定义View小Demo,关于Path类的使用(一)
  2. zw版【转发&#183;台湾nvp系列Delphi例程】HALCON color_fuses2
  3. zw版【转发&#183;台湾nvp系列Delphi例程】HALCON 3D Position Of Circles
  4. Openstack的用户登录流程
  5. sql server 数据库模型 备份 恢复 总结 备份脚本
  6. Intent跳转传list集合
  7. centos 7 systemctl
  8. selenium webdriver设置超时
  9. Java 基本数据类型 sizeof 功能【转】
  10. oracle日期函数2!