在我的項目中,我實現了一個水平滾動文本的股票動畫。UIViewAnimation增加內存
我的問題是當我去另一個viewcontroller內存開始不斷增加。
這裏是我的股票動畫代碼
-(void)scrollTheBreakingNews
{
if (isTicker)
{
self.ticker.text = textToScroll;
if (!pauseTicker)
{
if (isTicker)
{
NSAttributedString *str = [[NSAttributedString alloc]initWithString:textToScroll];
CGSize textSize = [str size];
if (isTicker)
{
float duration = (textSize.width + self.tickerView.frame.size.width)/65.0f;
float startingX=0.0f;
float endX=0.0f;
if (isTicker)
{
self.ticker.frame = scrollLabelFrame;
if (isTicker)
{
startingX = self.tickerView.frame.size.width;
endX = -textSize.width;
if (isTicker)
{
self.ticker.frame = CGRectMake(startingX, 0.0f, textSize.width, 25.0f);
[UIView beginAnimations:@"" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationDuration:duration];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(tickerStop)];
if (isTicker)
{
CGRect tickerFrame = self.ticker.frame;
tickerFrame.origin.x = endX;
if (isTicker)
{
[self.ticker setFrame:tickerFrame];
[UIView commitAnimations];
}
}
}
}
}
}
}
}
}
}
-(void)tickerStop
{
if (isTicker)
{
if (!pauseTicker)
{
[self scrollTheBreakingNews];
}
}
else
{
textToScroll=nil;
}
}
記憶是這樣的:
請幫我解決這個問題。任何建議感激。在此先感謝
'儀表中的配置文件'按鈕放置在那裏是有原因的,您可以使用它來查看佔用內存的內容。 –
我對分析不太熟悉。我簡介了我的應用程序,但我找不到哪個對象正在使用更多內存 –
這是非常直觀的工具,但您可以查看文檔以開始使用:[關於儀器](https://developer.apple.com/ library/ios/documentation/developertools/concepts/instrumentsuserguide/Introduction/Introduction.html),[在應用程序中查找內存問題](https://developer.apple.com/library/ios/documentation/developertools/conceptual/instrumentsuserguide/ MemoryManagementforYouriOSApp/MemoryManagementforYouriOSApp.html#// apple_ref/DOC/UID/TP40004652-CH11-SW1)。 –