开发者

Time Profiler: Optimizing UIImageView alloc/init calls

Time Profiler says that statements like these ar开发者_运维百科e 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


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


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:"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜