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

  • GUN-TIME with Brandon

    GUN-TIME wit

    3 ŞUBAT 2009
  • Kurtindo Pop Games

    Kurtindo Pop

    2 HAZİRAN 2013
  • Mindy

    Mindy

    20 NİSAN 2006