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

  • Influencer Plus

    Influencer P

    2 Ocak 2013
  • Kiddyzuzaa

    Kiddyzuzaa

    25 ŞUBAT 2014
  • wowchick16

    wowchick16

    17 Mart 2007