Reputation: 432
Currently i am generating "n" number of custom views in my DeatilViewController screen.So i want to calculate the number of views present in my DeatilViewController.xib
and they belongs to which class.
How can i do this?
Upvotes: 1
Views: 347
Reputation: 73588
Try NSArray *subViews = [DeatilViewController.view subviews];
or for their count
NSInteger count = [[DeatilViewController.view subviews] count];
Upvotes: 1
Reputation: 33048
UIViewController
has a property called view
that returns the controller's view. This UIView
in turns has a property subviews
that returns the subviews of the view.
Get the length of this array and you got your subviews.
Upvotes: 0