update object problem in ios

backendless gives success response on update query but values are not updating on every successful response. please help me.

This is how i am doing it

[Locations findLocationWhereObjectId:auser.objectId block:^(NSArray *locations)
{
if (locations.count > 0)
{
Locations *loc = [locations objectAtIndex:0];

Broadcasts *broadcast = loc.broadcast;
broadcast.broadcastDuration = self.videoTime;

[broadcast updateBroadcast:^(Fault *error)
{
if (error)
{
NSLog(@"Error : %@ ",error);
}
}];
}
}
errorMessage:^(Fault *error)
{
}];

Locations is a table which contains the object of Broadcast table. “broadcastDuration” is not updating at backendless server even if the response is successful. some times it is updated and sometimes not. “broadcastDuration data type is double”

this is the update Method in Broadcast class
-(void)updateBroadcast:(void (^) (Fault *error))error
{
[[backendless.persistenceService of:[Broadcasts class]] save:self response:^(id response)
{
error(nil);
}error:^(Fault *err)
{
error(err);
}];
}

Hi Waqar Ali.
We’ll investigate this issue and get back to you.

Thanks Anatolii, I am waiting for it.

Please provide appId & secretKey of your backendless app to support@backendless.com - we will investigate this issue.

Thanks for your reply. I have sent my App ID and secret key now waiting for your response. Thanks

You did not provide your Broadcast class, so check if your ‘broadcastDuration’ property is:

var broadcastDuration : Double?

You should change it to

var broadcastDuration : Double = 0.0

The numeric and boolean property must be initialized, foe example:

class TestNumerics : NSObject {
    var logic : Bool = false
    var count : Int = 0
    var real : Double = 0.0
    var afloat : Float = 0.0
}

Regards,
Slava

Please see the attached files.

Please see Vyacheslav’s response here. Plus there are no attached files.

Sorry, now see the attached file. This is how I am doing this.

Broadcasts class.rtf (3.75kB)

Thanks, Ali. What does VSBackendlessObject look like?

Hi Waqar,

In data model class all properties MUST be objects, so for boolean, int, float, double, etc you should use NSNumber. So, change all double to NSNumber* in your code, and try again.

Regards,
Slava

BTW: if you need geo location (longitude, latitude) you could use GeoPoint class of Backendless GeoService

Thanks Vyacheslav, i’ll try it.

VSBackendlessObject contains properties like objectId, ownerId, created and updated.

How could it be possible to save NSNumber object in the property of type double at the server ?

Hi Vyacheslav, I have changed the data type in my data modal class from double to NSNumber and still the problem is same, some times value is updated and some times not even if the type is NSString.

We cannot reproduce this issue.

Can you provide your project (or some sample project, demonstrating the issue) & your appId to support@backendless.com?