incontrando numerose perdite sul dispositivo iphone utilizzando NSOperationQueue e cercando di cambiare cursori/raccoglitori eccincontrano numerose dispersioni sulla dispositivo iphone quando si utilizza NSOperationQueue e cercando di cambiare cursori/raccoglitori ecc
sono in grado di cambiare le etichette senza problema, ma se provo a cambiare un cursore o un selettore entrambi creati sul generatore di interfacce ottengo queste perdite.
codiceLeaked Object # Address Size Responsible Library Responsible Frame
GeneralBlock-16 0x1b00a0 16 GraphicsServices GetFontNames
GeneralBlock-16 0x1aea90 16 WebCore WebThreadCurrentContext
GeneralBlock-16 0x1aea80 16 GraphicsServices GSFontGetFamilyName
GeneralBlock-64 0x1a7370 64 UIKit GetContextStack
sotto
- (void)loadData {
NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self
selector:@selector(firstRun)
object:nil];
[queue_ addOperation:operation];
[operation release];
}
- (void)firstRun {
NSAutoreleasePool *pool = [NSAutoreleasePool new];
[self setSliders];
NSLog(@"firstRun method end");
[pool drain];
}
- (void)setSliders {
NSMutableArray *tempArray = [[[NSMutableArray alloc]init] autorelease];
aquaplannerAppDelegate *appDelegate = (aquaplannerAppDelegate *)[[UIApplication sharedApplication] delegate];
tempArray = appDelegate.settingsValuesArray;
freshMarineSegment.selectedSegmentIndex = [[tempArray objectAtIndex:0]intValue];
for (int i = 1; i <= 20; i++) {
UILabel *label = (UILabel *)[self.view viewWithTag:200+i]; // gets label based on tag
UISlider *slider = (UISlider *)[self.view viewWithTag:100+i]; // gets slider based on tag
slider.value = [[tempArray objectAtIndex:i]intValue];
label.text = [[[NSString alloc] initWithFormat:@"%@",[tempArray objectAtIndex:i]] autorelease];
[label release];
[slider release];
}
}
grazie per le tue informazioni, vedrò i miei metodi che potrebbero essere impostati. e sì performSelectorOnMainThread era la chiave, cercherò anche di cambiare i miei array in thread separati agli NSArrays se i loro oggetti non cambiano – zambono