-1
我創建視圖並釋放所有對象。我用NSTimer和NSTimer和UIView內存錯誤
//at viewdidload
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval: 15.0
target: self
selector:@selector(selectorSwitcher:)
userInfo: nil repeats:YES];
NSRunLoop *runner = [NSRunLoop currentRunLoop];
[runner addTimer:timer forMode: NSDefaultRunLoopMode];
-(void)selectorSwitcher:(NSTimer *)timer {
[self viewDidLoad];
}
但myviews不能從滾動視圖中刪除。爲他人創造更多的意見。我該如何解決這個問題? 感謝
if (tempView.frame.origin.x > createview.frame.size.width) {
tempLabel = [[UILabel alloc] initWithFrame:CGRectMake((lblname_marginleft + (i * widthOfView))-((i/sutun)*mview_width), lblname_margintop + ((i/sutun) * heightOfView), labelwidth, labelheight)];
tempNumber = [[UILabel alloc] initWithFrame:CGRectMake((lblnumber_marginleft + (i* widthOfView))-((i/sutun)*mview_width), lblnumber_margintop + ((i/sutun) * heightOfView), labelwidth, labelheight)];
tempyuzde= [[UILabel alloc] initWithFrame:CGRectMake((15 + (i*widthOfView))-((i/sutun)*mview_width), 10 + ((i/sutun) * heightOfView), labelwidth, labelheight)];
tempView = [[UIView alloc] initWithFrame:CGRectMake((10 + (i* widthOfView)) - ((i/sutun)*mview_width), ((i/sutun) * heightOfView), widthOfView, heightOfView)];