SORU
30 NİSAN 2010, Cuma


Nasıl bir UİView ve onların subviews ve onların subviews tüm subviews döngü miyim

Nasıl bir UİView ve onların subviews ve onların subviews tüm subviews döngü miyim?

CEVAP
30 NİSAN 2010, Cuma


Özyineleme kullanımı:

// UIView HierarchyLogging.h
@interface UIView (ViewHierarchyLogging)
- (void)logViewHierarchy;
@end

// UIView HierarchyLogging.m
@implementation UIView (ViewHierarchyLogging)
- (void)logViewHierarchy
{
    NSLog(@"%@", self);
    for (UIView *subview in self.subviews)
    {
        [subview logViewHierarchy];
    }
}
@end

// In your implementation
[myView logViewHierarchy];

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • AllYourNewsByMe

    AllYourNewsB

    18 Temmuz 2011
  • Associated Press

    Associated P

    18 EYLÜL 2006
  • Dion Coulls

    Dion Coulls

    16 AĞUSTOS 2006