在启动时自动将对象添加到NSMutableSet ...(iphone)

[英]Adding object to an NSMutableSet automatically when it's initiated… (iphone)


I have this problem adding an object to NSSet...

我有这个问题,向NSSet添加一个对象...

The NSMutableSet *set "belongs" to main ViewController. I want to add an object (Wall) to this NSMutableSet automatically if I add it to view in interface builder... Wall is a subclass of UIImageView...

NSMutableSet *设置为“属于”主ViewController。如果我将它添加到界面构建器中的视图中,我想自动向该NSMutableSet添加一个对象(Wall)... Wall是UIImageView的子类...

Thanks :)

谢谢 :)

1 个解决方案

#1


0  

found a way how to do it :)

找到了办法怎么做:)

for(UIView *v in self.view.subviews) { if([v isKindOfClass:[Wall class]]) [obstacleSet addObject:v]; }

for(UIView * v in self.view.subviews){if([v isKindOfClass:[Wall class]])[obstacleSet addObject:v]; }


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2010/03/25/4725e5a86f2284592f733c1a2b808484.html



 
  © 2014-2022 ITdaan.com 联系我们: