Time Profiler:优化 UIImageView alloc/init 调用
Time Profiler 表示此类语句会减慢我的应用程序的速度。有没有更好的方法来编写这个以便我的应用程序运行得更快?
background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"myfolder.png"] highlightedImage:[UIImage imageNamed:@"myfolderOFF.png"]];
谢谢
Time Profiler says that statements like these are slowing my app down. Is there a better way to write this so that my app runs faster?
background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"myfolder.png"] highlightedImage:[UIImage imageNamed:@"myfolderOFF.png"]];
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将继续用“你不能”来回答我自己的问题。
但是,如果您遇到这样的问题,您可以尝试使用 C
http://iphonedevelopment.blogspot.com/2008/04/root-of-all-evil-introduction-to.html
I'm going to go ahead and answer my own question with a "you can't."
However if you have an issue like this you COULD try optimize using C
http://iphonedevelopment.blogspot.com/2008/04/root-of-all-evil-introduction-to.html
我在某处读到过“imageNamed:”是邪恶的,但它并没有真正导致性能下降。大多数报告都是关于奇怪的错误和崩溃的。
尝试“imageWithContentsOfFile:”
somewhere i've read about "imageNamed:" is evil, but it causes not really performance slowdowns. there were mostly reports off odd bugs and crashes.
Try "imageWithContentsOfFile:"