I have some problems with ARC. I'm trying to add multiples views to a ScrollView, and after that if the user tap one view will call a action.
But when user tap the view i get this message: "message sent to deallocated instance"
How can i retain the views?
this is my code in ViewController:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
int i;
for (i=0;i<10;i++) {
ChannelViewController *channelView = [[ChannelViewController alloc] init];
[channelView.view setFrame:CGRectMake(i*175, 0, 175, 175)];
//channelsScrollView is a ScrollView
[self.channelsScrollView addSubview:channelView.view];
}
[self.channelsScrollView setContentSize:CGSizeMake(i*175, 175)];
}