0
我有一個正常工作的程序。然後我從http://github.com/matej/MBProgressHUD下載了一些代碼,在做某事時顯示進度計。從NSMutableArray到NSData的對象更改爲NSString
這是使進度計彈出的代碼。該方法myTask
運行時
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
這將顯示一個進度條。
這是showWhileExecuting
方法的代碼。
- (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(BOOL)animated {
methodForExecution = method;
targetForExecution = [target retain];
objectForExecution = [object retain];
// Launch execution in new thread
taskInProgress = YES;
[NSThread detachNewThreadSelector:@selector(launchExecution) toTarget:self withObject:nil];
// Show HUD view
[self show:animated];
}
如果我用這個來調用函數myTask
然後我的類屬性的人會從NSMutableString
某處更改爲NSData
對象,然後以後它將改變一個NSString
。我沒有看到代碼中的任何地方導致這個改變,所以它可能是某種錯誤。內存是否損壞?是什麼導致了這種情況發生?
當我打開NSZombies時,我可以看到對象變成了NSZombie NSArray。 – 2010-10-07 17:38:34