Forum BigDB Error in Obj-C API?

Discussion and help relating to the PlayerIO database solution, BigDB.

Error in Obj-C API?

Postby coreyguo » May 5th, 2013, 4:53 am

Hi,

I think we've just found an error in removeObjectAtIndex method in Objective-C API 8-)

Below is the code we used to find and remove an object from the array, for some reason it KEEPS deleting the LAST element of the array regardless of what index you passed in.

Code: Select all
    MyObject *myobject=[MyObject sharedMyObject];
    PIODatabaseArray *array=[myobject.myAllPIODatabaseObject arrayForProperty:@"BuildingObjects"];
   
    for (int i=0; i<array.count; i++) {
        if ([sprite.SpritePIODatabaseObject isEqual:[array objectAtIndex:i]]) {
            [array removeObjectAtIndex:i];
            break;
        }
    }
   
    [myobject.myAllObjectInfo saveWithSuccessBlock:^{
    } errorBlock:^(PIOError *error) {
    }];



Also, is it possible to have a built-in method that removes a particular object by passing it as a parameter, something like this ---
Code: Select all
- (PIODatabaseArray*) removeObject:(PIODatabaseObject*)Obj;


Or do we have to write it ourselves, if so, any good idea on how to implement it efficiently?
coreyguo
Paid Member
 
Posts: 12
Joined: April 30th, 2013, 12:55 pm

Re: Error in Obj-C API?

Postby groomi » June 28th, 2013, 1:19 pm

There is an objective C API?

Where can I get this
groomi
Paid Member
 
Posts: 46
Joined: January 15th, 2013, 5:14 pm


Return to BigDB



cron