Wie Änderung int-Wert in Block, ich habe dies:Wie kann man den int-Wert im Block ändern?
__block long long size = -1;
ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)
{
ALAssetRepresentation * rep = [myasset defaultRepresentation];
size = [rep size];
//here showed normal value
NSLog(@"needed size : %lld",size);
};
ALAssetsLibrary* assetslibrary = [[[ALAssetsLibrary alloc] init] autorelease];
[assetslibrary assetForURL:self.tmpVideoURL
resultBlock:resultblock
failureBlock:nil];
//but here remaind -1
NSLog(@"out block value : %lld",size);
wofür ist das extra lang? – Ali
Wenn dies Ihr realer Code ist, besteht das Problem darin, dass der Block zu diesem Zeitpunkt nicht gerade ausgeführt wird. Wo genau befindet sich der zweite 'NSLog' in Ihrem Code? Sehen Sie tatsächlich "benötigte Größe" im Protokoll vor "out block Wert", oder sind sie umgekehrt? –
Eine Sekunde .. ich werde es bald aktualisieren! –