Procházet zdrojové kódy

Fixed a bug with future activities and prevented another when fetching location.

Iñigo Valentin před 9 roky
rodič
revize
f3e54804ea

+ 4 - 1
app/FetchLocation.swift

@@ -47,7 +47,10 @@ class FetchLocation{
 			if error != nil {
 				NSLog(":LOCATION:ERROR: Unknown error getting location: \(error.debugDescription)")
 			}
-			let status = (response as! HTTPURLResponse).statusCode
+			var status = 204
+			if (response != nil){
+				status = (response as! HTTPURLResponse).statusCode
+			}
 			
 			if status == 200{
 			

+ 6 - 1
app/FutureActivityViewController.swift

@@ -163,7 +163,12 @@ class FutureActivityViewController: UIViewController, UIGestureRecognizerDelegat
 							row = RowItinerary.init(s: "rowItinerary\(count)", i: count)
 							itiId = r.value(forKey: "id")! as! Int
 							itiTitle = r.value(forKey: "name_\(lang)")! as! String
-							itiText = r.value(forKey: "description_\(lang)")! as! String
+							if r.value(forKey: "description_\(lang)") != nil{
+								itiText = r.value(forKey: "description_\(lang)")! as! String
+							}
+							else{
+								itiText = ""
+							}
 							itiStart = r.value(forKey: "start")! as! NSDate
 							itiPlace = r.value(forKey: "place")! as! Int
 							place = getPlace(place: itiPlace, lang: lang, context: context)

+ 1 - 1
app/ScheduleViewController.swift

@@ -185,7 +185,7 @@ class ScheduleViewController: UIViewController, UIGestureRecognizerDelegate {
 			do {
 				let daySearchResults = try self.context?.fetch(dayFetchRequest)
 				for r in daySearchResults! {
-					name = r.value(forKey: "name_\(lang!)") as! String
+					name = (r.value(forKey: "name_\(lang!)") as! String).decode()
 				}
 				self.lbDayName.text = name
 			}