小编Ani*_*dha的帖子

单个视图控制器中的多个 WKwebkit 视图不起作用

我无法加载我的子视图。我将它们定义为弱WKWebKit插座。如果我这样做view = tickerViewview = graphView,它的工作原理,但它只加载其中之一。我想加载两者。我该怎么做?

    override func loadView() {

        tickerView = WKWebView()
        tickerView.navigationDelegate = self
        self.view.addSubview(tickerView)


        graphView = WKWebView()
        graphView.navigationDelegate = self
        self.view.addSubview(graphView)

    }
Run Code Online (Sandbox Code Playgroud)

user-interface uiview ios swift wkwebview

0
推荐指数
1
解决办法
518
查看次数

json serialization of a list of objects of a custom class

I have a song class, which holds the attributes to a song, and it is a custom class. I also have a list of songs in a list called track list. When I try to json.dump the list, I get an error that says :

TypeError: Object of type 'Song' is not JSON serializable
Run Code Online (Sandbox Code Playgroud)

How would I go about converting this list of songs to json?

Here is the additional relevant code that returns the error:

class Song:
def __init__(self, …
Run Code Online (Sandbox Code Playgroud)

python serialization json class python-3.x

0
推荐指数
1
解决办法
631
查看次数