Sunday, December 8, 2013

Groups seeking new ios is how to reference the control object

For example, an object can be obtained android control by findViewById way. In ios, I did not see a similar approach. Information pitiful. Seek expert explain.
Reply:
Understand correctly, you want to get a child object controls, child controls.
To initiate the code, but also look TELL
 
- (UIView *) findView: (UIView *) aView withName: (NSString *) name {
Class cl = [aView class];
NSString * desc = [cl description];
if ([name isEqualToString: desc])
return aView;
for (NSUInteger i = 0; i <[aView.subviewscount]; i + +)
{
UIView * subView = [aView.subviewsobjectAtIndex: i];
subView = [selffindView: subView withName: name];
if (subView)
return subView;
}
return nil;
}



Reply:
viewWithTag
Reply:
Thank you 2 much.

No comments:

Post a Comment