Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. rrr.swift:356:72: Ambiguous use of 'subscript'
  2.  
  3. self.restApi.getSchoolDetails(schoolId) {responseObject, error in
  4. // use responseObject and error here
  5.  
  6. self.schoolDetailsCollection = NSDictionary(dictionary: responseObject! as! [String : AnyObject])
  7. print(self.schoolDetailsCollection)
  8.  
  9. if let response = responseObject as? NSDictionary {
  10. //parse the response object
  11. self.schoolDetailsList = (response as? NSDictionary)!
  12.  
  13. //assigning all values to shareData class
  14. self.shareData.sco_id = response["result"]!["sco_id"] as!NSInteger
  15. self.shareData.address = response["result"]!["address"] as!String
  16. self.shareData.name = response["result"]!["name"] as! String
  17. print("school name")
  18. print(self.shareData.name)
  19. self.shareData.intro = response["result"]!["intro"] as! String
  20. self.shareData.sell_point = response["result"]!["sell_point"] as! String
  21. self.shareData.city = response["result"]!["city"] as! String
  22. self.shareData.cou_id = response["result"]!["cou_id"] as! String
  23.  
  24. //get images from the nested array in the json array
  25. /THESE THREE LINES CAUSE THE ERROR SUBSRCIPT
  26. self.shareData.image1 = response["result"]!["images"][0]! as! String
  27. self.shareData.image2 = response["result"]!["images"]![1] as! String
  28. self.shareData.image3 = response["result"]!["images"]![2] as! String
  29.  
  30. print(self.shareData.image1)
  31. print(self.shareData.image2)
  32. print(self.shareData.image3)
  33.  
  34.  
  35.  
  36. //open next controller after all info has been set correctly
  37. //info is being passed by Singleton class Sharedata
  38. if let COBezierDemoViewController = self.storyboard!.instantiateViewControllerWithIdentifier("COBezierDemoViewController") as? COBezierDemoViewController {
  39. self.presentViewController(COBezierDemoViewController, animated: true, completion: nil)
  40. }
  41.  
  42. }
  43.  
  44. }
  45.  
  46. }
  47.  
  48. {
  49. result = {
  50. address = "223 Vincent St, West Perth WA 6005, Australia";
  51. city = Perth;
  52. "cou_id" = AU;
  53. "cur_id" = "";
  54. environment = R;
  55. financed = "<null>";
  56. images = (
  57. "Phoenix_Academy_1.jpeg",
  58. "Phoenix_Academy_3.jpeg",
  59. "Phoenix_Academy_2.jpeg"
  60. );
  61. intro = "Our language school in Perth has a modern campus and a spacious garden. The language school is located 10 minutes north from the city center. You can reach the city center and the famous bea
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement