2017-01-19 1 views
0

이 코드를 실행할 때 오류가 발생합니다. 컬렉션 가져 오기에 shopify 프레임 워크를 사용하지만 앱이 다운됩니다. NSError에 오류가 나에게 내가 변경하여 해결 한신속 완료 블록의 EXC_BAD_INSTRUCTION

self.client = BUYClient(shopDomain: self.shopDomain, apiKey: self.apiKey, appId: self.appID) 
     self.client.getCollectionsPage(1, completion: {(collections:[BUYCollection]?, page: UInt, reachedEnd: Bool, error: NSError?) -> Void in 
      if (collections != nil) && error == nil { 
       print("fetching collections: \(collections)") 
       self.data=collections! as NSArray 
       self.fetchProducts() 

      } 
      else { 
       print("Error fetching collections: \(error!.localizedDescription)") 
      } 
     } as! BUYDataCollectionsListBlock //here an error occur 
    ) 

답변

0

도와주세요

self.client.getCollectionsPage(1, completion: {(collections:[BUYCollection]?, page: UInt, reachedEnd: Bool, error: Error?) -> Void in 

    if (collections != nil) && error == nil { 
     print("fetching collections: \(collections)") 
     self.data=collections! as NSArray 
     self.fetchProducts() 
    } 
    else { 
     print("Error fetching collections: \(error!.localizedDescription)") 
    } 
})