2017-03-26 12 views
0

因此,这里是我的代码:SPTSearch返回SPTListPage,但不能访问项目

SPTSearch.perform(withQuery: "This+Test", queryType: .queryTypePlaylist, accessToken: session.accessToken) { (error:Error?, result:Any?) in 
     if let err = error { 
      print(err) 
     } else { 
      print("no errors") 
     } 

     if let r = result as? SPTListPage { 
      print(r) 
      if let items = r.items { 
       print(items) 
      } else { 
       print("could not access Items") 
      } 
     } else { 
      print("could not typecast to SPTListPage") 
     } 
    } 

和这里的调试输出:

no errors 
<SPTListPage: 0x600000289290>: 0-18446744073709551615 of 23 items 
could not access Items 

它看起来像我得到一个列表页面,但不能上网任何方式的项目,发生了什么?

+0

我不过可以访问 r.totalListLength和它正常工作 –

回答