Kaynağa Gözat

Fixed several errors from merging the Sync and Lablanca branches.

Iñigo Valentin 9 yıl önce
ebeveyn
işleme
c9c2e3061c

+ 1 - 0
app/Base.lproj/Main.storyboard

@@ -953,6 +953,7 @@
                 <placeholder placeholderIdentifier="IBFirstResponder" id="rq0-MV-vyl" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
             <point key="canvasLocation" x="-2839" y="1801"/>
+        </scene>
         <!--Sync-->
         <scene sceneID="cqg-BI-2xm">
             <objects>

+ 6 - 1
app/ScheduleViewController.swift

@@ -126,7 +126,12 @@ class ScheduleViewController: UIViewController, UIGestureRecognizerDelegate {
 			for r in searchResults as [NSManagedObject] {
 				
 				title = r.value(forKey: "title_\(lang)") as! String
-				text = r.value(forKey: "description_\(lang)") as! String
+				if let tx = r.value(forKey: "description_\(lang)"){
+					text = r.value(forKey: "description_\(lang)") as! String
+				}
+				else{
+					text = ""
+				}
 				start = r.value(forKey: "start")! as! NSDate
 				locationId = r.value(forKey: "place")! as! Int
 				row = RowSchedule.init(s: "rowSchedule\(rowcount)", i: rowcount)

+ 6 - 3
app/Sync.swift

@@ -1663,8 +1663,11 @@ class Sync{
 			
 			//Get host
 			str = str.subStr(start : str.indexOf(target : ",\"")! + 1, end : str.length - 1)
-			let host: Int = Int(str.subStr(start : str.indexOf(target : "\"host\":")! + 8, end : str.indexOf(target : ",\"")! - 2))!
-			row.setValue(host, forKey: "host")
+			let strHost: String = str.subStr(start : str.indexOf(target : "\"host\":")! + 8, end : str.indexOf(target : ",\"")! - 2)
+			if (strHost != "ul"){ //From "null"
+				let host: Int = Int(strHost)!
+				row.setValue(host, forKey: "host")
+			}
 			
 			//Get place
 			str = str.subStr(start : str.indexOf(target : ",\"")! + 1, end : str.length - 1)
@@ -1680,7 +1683,7 @@ class Sync{
 			//Get end
 			str = str.subStr(start : str.indexOf(target : ",\"")! + 1, end : str.length - 1)
 			dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
-			let strEnd =  str.subStr(start : str.indexOf(target : "\"end\":")! + 7, end : str.length - 2)
+			let strEnd: String =  str.subStr(start : str.indexOf(target : "\"end\":")! + 7, end : str.length - 2)
 			if (strEnd != "ul"){ //From "null"
 				let end = dateFormatter.date(from: strEnd)!
 				row.setValue(end, forKey: "end")

+ 1 - 0
app/ViewController.swift

@@ -131,6 +131,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 			else{
 				(segue.destination as! ScheduleViewController).margolari = false
 			}
+		}
 		if segue.identifier == "SegueSync"{
 			self.syncSegue = segue
 		}