ios - NSOrderedSet is not convertible to NSManagedObject -


I'm partially following the tutorial with Ray Vendorlich (if you search for 'Save Run' This should jump in part about this question). I have also tagged it with 'swift', because I do not know that it is fast due to any problem (because it is working in the tutorial which is in Objisi).

I'm currently stuck on saving location data in the CoreData data model.

Code here for my saved session method:

  func saveSession () {var newSession: session = NSEntityDescription.insertNewObjectForEntityForName ("Session", Managed Object Contex: Management Object Contains!) As the session new session.imestamp = NSDate () var tempArray = [AnyObject] () for self. Place newlocationArray {var location: location = NSEntityDescription.insertNewObjectForEntityForName ("Location", Managed Object Contact: Self.managedObjectContext!) As the location location. Timestamp = newLocation.Timestamp location.latitude = newLocation.coordinate.latitude location.longitude = newLocation.coordinate.longitude location .altitude = newLocation.altitude location. Title = new location Top Location Movement = NewLocation.hor IzontalAccuracy location.verticalAccuracy = newLocation.verticalAccuracy tempArray.append (location)} // This is a line generating error: // 'NSOrderedSet' is not variable for 'NSManagedObject' new session.locations = NSOrderedSet (array: tempArray)}   

This is my data model:

session unit  session unit

location unit  location unit

Let me know if any more code / information is needed to solve it . Any help is greatly appreciated.

You defined the locations property "one-one" relationship "Many" relationships should be

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -