Backendless Support
 
Solved

Auto Generated iOS Code Error - LoadRelationsQueryBuilder

Hi,

I generated the CRUD code from the interface on Backendless. I wanted to view a couple of scenarios. When I tried to compile it I received the below error. Now I'm making the assumption there is now Table called SampleTable, I have attempted to fix this to one of the tables that I have within my database (FlightLog). Being generated I would have thought it would have retrieved the names of the tables within my administration area. Thats what it use to do. I haven't touched anything to the generated code...ideas?

The error is in the ActionViewController.m

No visible @interface for 'LoadRelationsQueryBuilder' declares the selector 'initWithClass:'

--

else if ([self.actionType isEqualToString:@"related"]) {

LoadRelationsQueryBuilder *loadRelationsQueryBuilder = [[LoadRelationsQueryBuilder alloc] initWithClass:[SampleTable class]]; <------THIS LINE HERE

for (NSString *property in self.properties) {

[loadRelationsQueryBuilder setGetRelationName:property];

}

[backendless.data find:[SampleTable class]

queryBuilder:[DataQueryBuilder new]

response:^(NSArray *retrievedData) {

DataCollectionViewController *dataCollectionVC = (DataCollectionViewController *)[self.storyboard instantiateViewControllerWithIdentifier:@"DataCollectionViewController"];

dataCollectionVC.data = retrievedData;

dataCollectionVC.isSort = NO;

dataCollectionVC.actionType = self.actionType;

dataCollectionVC.loadRelationsQueryBuilder = loadRelationsQueryBuilder;

[self.navigationController pushViewController:dataCollectionVC animated:YES];

isRunCode = NO;

}

error:^(Fault *fault) {

resultVC.isSuccess = NO;

resultVC.text = fault.message;

[self.navigationController pushViewController:resultVC animated:YES];

isRunCode = NO;

}];

}

Cheers,

Jeremy

Leave a Comment

Comments (5)

photo
1

Hello jeremy,

The signatures changed a little and we'll fix this issue as soon as possible.

Please replace

  1. LoadRelationsQueryBuilder *loadRelationsQueryBuilder = [[LoadRelationsQueryBuilder alloc] initWithClass:[SampleTable class]];

with

  1. LoadRelationsQueryBuilder *loadRelationsQueryBuilder = [LoadRelationsQueryBuilder of:[SampleTable class]];

and

  1. [loadRelationsQueryBuilder setGetRelationName:property];

with

  1. [loadRelationsQueryBuilder setRelationName:property];

Regards, Olga

photo
1

One Last thing,

I haven't tried with SWIFT but I'm making the assumption that it also needs to be changed?

Jeremy

photo
1

Yes, you're right:

  1. let loadRelationsQueryBuilder = LoadRelationsQueryBuilder.of(SampleTable.ofClass())!

Regards, Olga

photo
1

Excellent,

Thank you.

Jeremy

photo
photo
1

Thanks Olga,

I'll make the changes today.

Cheers!

Jeremy