I have one class in which i have two method _addView() and _removeView().
And these method i am using in another class for adding view and removing view but its not working.If i am using in the same then its working.
For Remove-
- (id)deleteBoxAtIndex:(int)boxIndex{
for (int i = 0; i < [[self subviews] count]; i++ ) {
[[[self subviews] objectAtIndex:boxIndex] removeFromSuperview];
}
return self;
}
Then how i count the subviews in that class or remove from that class.
You should pass a pointer to the
UIViewinstance (the one that has got thesubviews) to the other object so that you can call:I don’t know if this could work for you:
If you give more detail about the relationship between the two classes you mention (basically, the names and how one interact with the other), I could give you more hints.