2011-05-04 1 views

답변

3

[UIImage imageNamed:]은 이미지를 캐시합니다. 대신 [UIImage imageWithData:]을 사용해보세요.

+0

추가 정보 : http : // stacko verflow.com/questions/316236/uiimage-imagenamed-vs-uiimage-imagewithdata –

2

예, 작동합니다. 우리의 응용 프로그램에서 우리는 또 다른

1과 같은 방법)

[self.view setBackgroundColor:[UIColor colorWithPatternImage: 
    [UIImage imageWithContentsOfFile:[ 
     [NSBundle mainBundle] pathForResource:@"mainScreenBackground" ofType:@"png"]]]]; 

촬영 메모리 사용량과 22메가바이트

2)

[self.view setBackgroundColor:[UIColor colorWithPatternImage: 
    [UIImage imageWithData: 
     [NSData ] pathForResource:@"mainScreenBackground" ofType:@"png"]]]]; 

촬영 메모리 사용 15메가바이트
덕분에 많이

비교
관련 문제