Support Topics Documentation Slack YouTube Blog

Can't retrieve data from new table


(Chris) #1

I manually created a new table in my database and added data via backendless console. When I try to get the data using iOS api I get a failure. The same code works if I just change the class name to one of my other preexisting classes so I think its something like the new table isn’t fully registered in backendless so it can’t look for it.

When I was creating the table I tapped the button to add a table, entered the name and clicked the button to submit. At this point I got an error saying a table with that name already existed (which it didn’t). When I then cancelled the table was displayed in my list of tables.

App iD: 2D5E4E14-7AC6-5DA8-FF4E-03394E386B00
Error: Error: Optional(“Table not found by name ‘Table not found by name ‘Market’. Make sure the client class referenced in the API call has the same literal name as the table in Backendless console’”)

Update: Tried deleting the table and adding it again. The newly added table (using the same name as the deleted one) shows in the table viewer with 3 records even thought its brand new and I haven’t added anything. The table I previously deleted had 3 records, looks like they’re getting persisted somehow, though I can’t see them.


(Sergey Chupov) #2

Hello Chris,

Can I test deletion and creation of the Market table in the app you provided?


iOS app - Backendless seems not to see the table I've created
(Chris) #3

Yes, thats fine, thanks


(Sergey Chupov) #4

I did an export on the current Market table and its data to restore it after tests. Just letting you know so that you’re not bothered by the email notification.


(Sergey Chupov) #5

Your application has been fixed. This was an issue with encoding in the database.


(Chris) #6

Working now, thanks. Anything I can do to avoid the problem in the future? I’m working on a new feature in a dev environment right now but will want to make the same changes to my production database soon.


(Chris) #7

Spoke a bit too soon. This seems to be partially fixed. I have 5 properties in my table, 2 strings 3 doubles. When I make the call it now appears to be successful and returns the records from the table but only the string properties are getting returned. The Double properties are returned as null even though they’re populated

Screenshot shows the table with the data and the response I get from backendless with nil values for lat, long, range.


(Olga Danylova) #8

Hello Chris,

For Swift data objects, the Bool , Int , Double and Float types must not be declared optional:

@objcMembers
class SampleDataObject : NSObject {

    var objectId : String?
    var counter: Int = 0
    var isPublished: Bool = true
}

You can find more info here: https://backendless.com/docs/ios/data_data_object.html

Regards,
Olga