小编Ste*_*cks的帖子

UIView是Swift 3中的KindOfClass

所以我有这个代码:

if view.isKindOfClass(classType){...}
Run Code Online (Sandbox Code Playgroud)

这在Swift 2中运行良好,但是现在我在Swift 3中,我得到了这个错误:

类型的值UIView没有成员isKindOfClass

我如何在Swift 3中测试它?

uiview swift swift3

16
推荐指数
2
解决办法
2万
查看次数

将json数据从php返回到ajax

我正在尝试从php获取一个json对象,所以我可以在ajax中使用它.这是我的ajax代码:

 $.ajax({
   type: 'get',
   url: eventsListPath,
   dataType : "json",
   data: {},
   success: function (data) {
       $('#eventInformation').html(data.table);
       alert(data.table);
   }
});
Run Code Online (Sandbox Code Playgroud)

我的PHP:

$obj->table="hey";
echo json_encode($obj, JSON_UNESCAPED_SLASHES);
Run Code Online (Sandbox Code Playgroud)

但行

alert(data.table);
Run Code Online (Sandbox Code Playgroud)

以'undefined'回来.有任何想法吗?

javascript php ajax jquery json

5
推荐指数
1
解决办法
1270
查看次数

标签 统计

ajax ×1

javascript ×1

jquery ×1

json ×1

php ×1

swift ×1

swift3 ×1

uiview ×1