I having scroolViewController having UIImageView and UITextView.so how we fatch the UItextView text and image of UIImage.it gives error…
for(UIView *subview2 in [scroolViewController subviews])
{
NSLog(@"-----%@",subview2);
if([subview2 isKindOfClass:[UIImageView class]])
{
[dictImages setValue:subview2.image forKey:@"positionY"];
}
if(subview2 isKindOfClass:[UITextView class])
{
[dicText setValue:subview3.text forKey:@"text"];
}
}
Or when we writhe this
for(UIView *subview2 in [scroolViewController subviews])
{
NSLog(@"-----%@",subview2);
}
then console gives:
-----<UITextView: 0xb8791d0; frame = (5 10; 285 340); text = ''; clipsToBounds = YES; userInteractionEnabled = NO; layer = <CALayer: 0xb860a30>; contentOffset: {0, 0}>
-----<UIImageView: 0xb0c9d10; frame = (134 118; 100 100); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0xb0c8600>>
so how we save text and image dictionary from getting subviews…????
To fix the compiler error, do:
Since you’ve already checked that it’s the right class, casting it is fine.
Is
dictImagesanNSMutableDictionary?