Query Order by in Objective C

Hello to all my backendless Date I have a table called REGIONS
in this table I have a “Region” column called where inside there are all the regions of Italy …
So far so good I just have a problem … I can not produce a query in ascending order … I give you an example
Currently in my table view I view:
Basilicata
Lazio
Tuscany
Abruzzo
Obviously, as all you will understand, the Abruzzo region called should stay in first position on top of Basilicata …
I tried this way but have not managed to solve the problem … does not change anything … Where am I doing wrong?

QueryOptions *option = [QueryOptions new];
option.sortBy = @[@“regione DESC”];
BackendlessDataQuery *query = [BackendlessDataQuery query];
query.queryOptions = option;
[backendless.persistenceService find:[NGRegion_DB class] dataQuery:[BackendlessDataQuery query] response:^(BackendlessCollection *regionList) {
_regionArray = [regionList getCurrentPage];

for (NGRegion_DB *regionDb in _regionArray) {
NSLog(@“Region name = %@”, regionDb.regione);
NSLog(@“Region number = %@”, regionDb.numero_universita);
[self.tableView reloadData] ;
}

} error:^(Fault *fault) {
NSLog(@“Server reported an error: %@”, fault);
}];

Hi Fabio,

What do you get when you request it like this:

option.sortBy = @[@"regione"];

If it still does not work with that change, please attach a screenshot of the REGIONS table from backendless console.

Regards,
Mark

Hello Mark, I do not know what happened but now everything works perfectly … I have not touched or changed anything so I do not know why I could not order the query, maybe I had problems with XCode, however now everything is ok.

I wanted to ask you a question … I’m working on the internet and I wanted to check that the check can also reach the server. The few words I would like to check the status of User of the internet connection and the server to be able to edit my alerts controllers to show the typical warning.

if the user does not have internet access the error is “no internet connection”
if the user does not have internet problems but the problem is the server Down then I squeeze out the alert “Server not responding”

to do this I need a connecting link to the backendless server to check whether it is active or not you tell me which links can I place?

Fabio,

If there is a problem communicating with the server, then the API will be returning a fault (depending on the method you use, the fault could be (1) an exception or (2) a Fault object you pass into the method or (3) delivered through responder or (4) a block-based callback. Decide which approach fits the best your app and always check for faults.

Regards,
Mark

Perfect Mark … Thank you!