hi, i'm using the following code to get the property date of the video but the problem is it return as NSdate and when i tried to assigned it to UILabel.text in UItable the program crash on me. Can anyone help me?
void (^assetEnumerator)(struct ALAsset *,NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop){
if(result != nil){
//[Asset addObject:result];
if ([[result valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypeVideo]) {
// asset is a video
[Asset addObject:result];
NSString *CamDuration = [result valueForProperty:ALAssetPropertyDate];
}
}
};
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
CGRect frame = CGRectMake(125, 12, 200, 19); UILabel *CamDurationLabel = [[UILabel alloc] initWithFrame:frame]; CamDurationLabel.tag = 1; [cell.contentView addSubview:CamDurationLabel]; CamDurationLabel.text = CamDuration;
}