Comments (7)
That crash is probably due to the unconditional cast (as Round
). This isn't specific to Meteor but is a common issue when working with Core Data. It usually means the managed object model hasn't been configured correctly. Make sure you include the module name if you're mapping to a Swift class (see image).
from meteor-ios.
Thanks, you were on the right track. In the end, I had to add the following above the Round class to stop it from crashing.
@objc(Round)
The problem remains though, the first snippet above now saves to meteor, but still doesn't save to core data. Any other ideas?
from meteor-ios.
I got it working without resorting to @objc(Round) using your first solution. Still no luck getting data to save to Core Data though
from meteor-ios.
Good to hear that worked. What do you mean exactly by not saving to Core Data? If the change happens on the server, saving seems to be working. Do you mean the UI doesn't update? Do you use NSFetchedResultsController
or manual observing to respond to updates?
from meteor-ios.
How can I insert a new managed object into an existing managed object as a subobject using your implementation, and have it map correctly to the meteor collection? For example...
let round = NSEntityDescription.insertNewObjectForEntityForName("Round", inManagedObjectContext: self.managedObjectContext) as Round
round.name = "foo"
let subObject = NSEntityDescription.insertNewObjectForEntityForName("subObject", inManagedObjectContext: self.managedObjectContext) as SubObject
subObject.name = "bar"
round.subObject = subObject
{
name: "foo",
subObject: {
name: "bar"
}
}
from meteor-ios.
There is no support for nested objects right now. Unlike regular Mongo data modelling, using top level objects seems preferable in Meteor for most relationships, because that makes it much easier to deal with subscriptions and authorization for example. But there are use cases for nested objects, so if I have a need for it I might add it later.
Note that you can map value objects like dictionaries and arrays to nested JSON structures, if you set the type to 'Transformable' in the managed object model. I use this to map the 'profile' named values in the 'users' collection for example.
from meteor-ios.
That makes sense as to why I was having issues, thanks
from meteor-ios.
Related Issues (20)
- When using local IP of my macbook where meteor is running not able to connect to iPhone (ws://local IP:4000/websocket) HOT 1
- managedObjectContext nil - NSFetchedResultsController
- How to refactor METAccount so we can pass in our own service and access group to keychain?
- [IOS][1.3+] WKWebView terminated [White Screen of Death] - kills Geofence events HOT 5
- Not able to get the document ID from the collection. HOT 3
- hello @import Meteor;
- You this is written in Swift, please HOT 1
- preform complex fetches via METFetchRequest to METDatabase#executeFetchRequest:
- Mobile-config.js - App.info: Team HOT 1
- Application crash after assertionFailure in sendMessage Meteor/METDDPConnection.m:74 HOT 1
- How to listen subscription with METDDPClient HOT 1
- retry opening connection
- How to to get notified for specific collection changes?
- How to correctly use updateDocumentWithID? HOT 2
- Support meteor 1.5?
- How to log Out in Swift?
- Custom Mapping to Coredata
- Is this still being maintained? HOT 1
- How to listen to the subscriptions?
- Library not loaded: @rpath/InflectorKit.framework/InflectorKit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-ios.