Showing posts with label ALAsset. Show all posts
Showing posts with label ALAsset. Show all posts

Monday, October 24, 2011

Invalid attempt to access ALAssetPrivate past the lifetime of its owning ALAssetsLibrary

Trying to upload hundreds of images from device, but application occasionally crashes with this error note:
invalid attempt to access ALAssetPrivate past the lifetime of its owning ALAssetsLibrary
Basically it means what it says. Library was closed before reading the image data was completed. As result upload failed due missing or too short data. ALAssetsLibrary Class Reference says:

Monday, September 19, 2011

Conversion specifies type 'unsigned int' but the argument has type 'unsigned long long'

Been quite busy with maintenance issues lately (close to release), no time to blog. So here's just a small tip until I get into more interesting new development tasks:
unsigned long long bodyLen =
  (unsigned long long) [self.bodyPrefix length] +
  // ALAsset defaultRepresentation size returns (long long)
  (unsigned long long) fileSize +
  (unsigned long long) [self.bodySuffix length];
DLog(@"Total data size to send: %llu", bodyLen);
[request setValue:[NSString stringWithFormat:@"%llu", bodyLength] forHTTPHeaderField:@"Content-Length"];
In case you missed, the "printf" parameter to display unsigned long long is %llu...