I basically have it
@implementation MyView : CPView
{
CPArray MyPanelArray;
}
- (void)initMyView
{
...
}
MyPanels are quite a few image wrappers. When everything is initialized, it is perfectly drawn. Then I have a slider to control the position of the images, and the only way I know how to redraw everything is to overwrite MyView with a new instance, and basically the contentView to do something like
- (void)sliderAction:(id)sender
{
var myNewView = [MyView initWithPositionValue:[sender value]];
[_contentView replaceSubview:_myView with:myNewView];
_myView = myNewView;
}
Everything works correctly, but I doubt that this is the “right way”.
* I know that I can use CPCollectionView for a basic installation, but this will not work for what I'm trying to accomplish.
Thanks in advance.
Felix source
share