1

I have iOS 6 application that consists of UIView with many UIButtons (like 9 to as many as 100) displayed at same time; all buttons are movable, so I'm changing button's frame property all the time.

After using the application for a couple of minutes (= moving buttons around the parent UIView), app slows down. It is very strange also that it seems buttons that are near the bottom of the screen (= parent UIView) are much slower than those on the top of screen.

All buttons belong to same class, inherited from generic UIButton.

It happens only on real device, not iPhone simulator.

Any idea about the issue? I'm using NSlog frequently through the code. Can this be the problem?

Thx, DJ

4

2 回答 2

3

是的你是对的。

切勿在发布版本中提供 NSLog 或 DLog ..

删除所有 nslog,或出于测试目的将它们注释掉。

#ifdef DEBUG
  NSLog(@"log");
#endif

或者

#define NSLog //NSLog

您还应该检查僵尸和内存泄漏。

于 2012-11-30T08:58:28.130 回答
3

您可以将您的 NSLogs 设置为仅在 DEBUG 模式下,在 Relese 中会更快:

#ifdef DEBUG
  NSLog(@"log");
#endif
于 2012-11-30T08:56:25.943 回答