The right way to create place is:
QBLPlace *place = [QBLPlace place];
place.geoDataID = 34691;
place.photoID = 447;
place.title = [NSString stringWithFormat:@"%@",[aView.annotation title]];
place.address = @"London, Gadge st, 34";
place.placeDescription = @"My place description";
[QBLocation createPlace:place delegate:self];
where:
- geoDataID - ID of QBLGeoData object
- photoID - ID of QBCBlob object
Your error says that you have to create file with photo and then connect it to place.
To upload file please use this code:
NSData *file = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Hotel47" ofType:@"png"]];
[QBContent TUploadFile:file fileName:@"Hotel47 Image" contentType:@"image/png" isPublic:YES delegate:self];
#pragma mark -
#pragma mark QBActionStatusDelegate
- (void)completedWithResult:(Result *)result{
// Upload file result
if(result.success && [result isKindOfClass:[QBCFileUploadTaskResult class]]){
// File uploaded, do something
QBCBlob *uploadedFile = ((QBCFileUploadTaskResult *)result).uploadedBlob;
NSUInteger photoID = uploadedFile.ID; // use this as photo IS for place
}else{
NSLog("errors=%@", result.errors);
}
}
To create GeoData please use next code:
QBLGeoData *geodata = [QBLGeoData geoData];
geodata.latitude = 23.2344;
geodata.longitude = -12.23523;
geodata.status = @"Hello, world";
[QBLocation createGeoData:geodata delegate:self];
#pragma mark -
#pragma mark QBActionStatusDelegate
- (void)completedWithResult:(Result *)result{
// Check-in result
if(result.success && [result isKindOfClass:QBLGeoDataResult.class]){
QBLGeoDataResult *checkinResult = (QBLGeoDataResult *)result;
NSUInteger geoDataID = checkinResult.geoData.ID; // your geo data ID
}else{
NSLog(@"errors=%@", result.errors);
}
}