Closed fusjh2o closed 11 years ago
i‘ve got the same issue~ reload doesn't work
@fusjh2o and @iSeekF
Sorry for the terribly long delay on this. I haven't had time to work on the control much lately but will try to take a look at this soon.
@iSeekF,
I have committed an additional branch tonight in hopes of finding what might be causing your problem. In all of the demo branches, I have a button that when tapped, changes the data and then calls reloadData.
Can you point me to some sample code of what you are doing and how it's not working? If not code, could you provide some additional background information? Would love to help sort this out.
gonna go ahead and close this one. please let me know if you have some additional information that could help me understand what's going on.
thanks for creating V8HorizontalPickerView. Using (UIView )horizontalPickerView:(V8HorizontalPickerView )picker viewForElementAtIndex:(NSInteger)index, 'reloadData" doesn't work thought when changing data.
Answer: we need change -(void)dealloc{}.and -(id) initWithFrame:(CGRect) frame. as follows:
pragma mark - Init/Dealloc
(id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { elementWidths = [[NSMutableArray array] retain];
} return self; }
if 0 //code from network. but releadData, crash.
(void)dealloc { _scrollView.delegate = nil;
[_scrollView release]; [elementWidths release]; [elementFont release]; [leftEdgeView release]; [rightEdgeView release];
[leftScrollEdgeView release]; [rightScrollEdgeView release];
[textColor release]; [selectedTextColor release];
if (selectionIndicatorView) { [selectionIndicatorView release]; }
[super dealloc]; }
else
(void)dealloc { _scrollView.delegate = nil;
[_scrollView release]; _scrollView = nil;
[elementWidths release]; elementWidths = nil;
[elementFont release]; elementFont = nil;
[leftEdgeView release]; leftEdgeView = nil;
[rightEdgeView release]; rightEdgeView = nil;
[leftScrollEdgeView release]; leftScrollEdgeView = nil;
[rightScrollEdgeView release]; rightScrollEdgeView = nil;
[textColor release]; textColor = nil;
[selectedTextColor release]; selectedTextColor = nil;
if (selectionIndicatorView) { [selectionIndicatorView release]; selectionIndicatorView = nil; }
[super dealloc]; }
endif
. more, thanks for veader.