As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
NSLocalizedDescription=Entity does not have property 'sport' as specified in hostToKinveyPropertyMapping, NSLocalizedFailureReason=Cannot map 'X', a non-existant property
S
Samuel Wong
started a topic
over 7 years ago
Hey guys,
I'm having an issue saving an object, getting the error:
error : Error Domain=KCSAppDataErrorDomain Code=60102 "Entity does not have property 'sport' as specified in hostToKinveyPropertyMapping" UserInfo={NSLocalizedRecoverySuggestion=Check the hostToKinveyPropertyMapping for typos and errors., NSLocalizedDescription=Entity does not have property 'sport' as specified in hostToKinveyPropertyMapping, NSLocalizedFailureReason=Cannot map 'sport', a non-existant property}
As I understand it, the collection doesn't have a column "sport." The only problem is that is does. Here is my code:
Class:
class Event: NSObject {
var objectId:String!
var sport:Int!
var numberOfPlayers:Int!
var skillLevel:Int!
var date:NSDate!
var time:NSDate!
var competitive:NSNumber!
override func hostToKinveyPropertyMapping() -> [NSObject : AnyObject]! {
return [
"objectId" : KCSEntityKeyId,
"sport" : "sport",
"numberOfPlayers" : "numberOfPlayers",
"skillLevel" : "skillLevel",
"date" : "date",
"time" : "time",
"competitive" : "competitive"
]
}
}
Saving :
func GameSetUpView_didTapFindPlayersButton(playerQuantity: Int, skillLevel: Int, date: NSDate, time: NSDate, competitive:Bool) {
let event = Event()
event.sport = 0
event.numberOfPlayers = playerQuantity
event.skillLevel = skillLevel
event.date = date
event.time = time
event.competitive = competitive
let store = KCSAppdataStore.storeWithOptions([
KCSStoreKeyCollectionName : "Event",
KCSStoreKeyCollectionTemplateClass : Event.self
])
store.saveObject(event, withCompletionBlock: { (objects, error) -> Void in
if error != nil { print("error : \(error)"); return }
print("saved objects")
}, withProgressBlock: nil)
}
And my dashboard:
Any ideas?
Best Answer
S
Samuel Wong
said
over 7 years ago
FIXED: You cannot use Int types. Instead, any number types should be NSNumber
Do either of those "sports" have values in them? The databrowser isn't an accurate representation of what's happening. If you didn't save any values to that "column" (it's actually a disservice calling it a column, because it's Mongo data, and it's not a column, it's just data) then you still can't query on it.
Your code looks about right otherwise.
S
Samuel Wong
said
over 7 years ago
In the "Saving" part, sport is set to 0. Do I have to do anything else before saving? The error is displayed instantaneously, leading me to think that the error is caused due to some error in the app.
S
Samuel Wong
said
over 7 years ago
I added a sample object in via the dashboard, however I still can't save objects. Getting the same error
S
Samuel Wong
said
over 7 years ago
Answer
FIXED: You cannot use Int types. Instead, any number types should be NSNumber
Samuel Wong
Hey guys,
I'm having an issue saving an object, getting the error:
error : Error Domain=KCSAppDataErrorDomain Code=60102 "Entity does not have property 'sport' as specified in hostToKinveyPropertyMapping" UserInfo={NSLocalizedRecoverySuggestion=Check the hostToKinveyPropertyMapping for typos and errors., NSLocalizedDescription=Entity does not have property 'sport' as specified in hostToKinveyPropertyMapping, NSLocalizedFailureReason=Cannot map 'sport', a non-existant property}
As I understand it, the collection doesn't have a column "sport." The only problem is that is does. Here is my code:
Class:
Saving :
And my dashboard:
Any ideas?
FIXED: You cannot use Int types. Instead, any number types should be NSNumber
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstDamien Bell
Do either of those "sports" have values in them? The databrowser isn't an accurate representation of what's happening. If you didn't save any values to that "column" (it's actually a disservice calling it a column, because it's Mongo data, and it's not a column, it's just data) then you still can't query on it.
Your code looks about right otherwise.
Samuel Wong
In the "Saving" part, sport is set to 0. Do I have to do anything else before saving? The error is displayed instantaneously, leading me to think that the error is caused due to some error in the app.
Samuel Wong
I added a sample object in via the dashboard, however I still can't save objects. Getting the same error
Samuel Wong
FIXED: You cannot use Int types. Instead, any number types should be NSNumber
-
Why do I get "Undefined symbols" errors when building with KinveyKit?
-
How do I register push tokens?
-
When using social login, to perform a log-out, do I need to log out of the social network, Kinvey, o
-
How can I assign additional properties to users?
-
Does KinveyKit support 64-bit ARM devices, such as iPhone 5s?
-
Authorization Token Invalid or Expired
-
BOOL and how it is stored in the database.
-
Offline saving throwing errors
-
Custom endpoint not able to form request object
-
Security through business logic
See all 437 topics