2013-01-11 4 views
0

나는 심각하게 붙어 있습니다. 난 주로 apple docs에서 코드를 사용하고 잘 작동합니다. 이제 1 부분을 변경하려고하는데 오류가 계속 발생합니다 !!PDF를 그리는 경우 CFAttributedString

CFAttributedStringRef currentText = CFAttributedStringCreate(NULL, (CFStringRef)textView.text, NULL); 
if (currentText) { 
    CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(currentText); 
    if (framesetter) { 

은 내가 PDF는 텍스트 뷰에 반대 문자열의 데이터로 구축되도록, 하나의 문자열로 textView.text을 대체하려고 노력하지만,하고 나는

CFAttributedStringRef currentText = CFAttributedStringCreate(NULL, (CFStringRef)stringHere, NULL); 
에 그 코드를 변경할 때 나는 또한 시도했다

Thread 1: EXC_BAD_ACCESS (code=1, address0x0). 

:와

그것은 오류가 나에게

CFStringRef stringRef = (CFStringRef)stringHere; 
CFAttributedStringRef currentText = CFAttributedStringCreate(NULL, stringRef, NULL); 

하지만 같은 오류가 발생합니다. 누구든지 도와 줄 수 있습니까?

답변

1

문자열은 0x0입니다 (일명 NULL이 아님)

+0

예를 들어 제가 확인하지 못한 것이 발견되었습니다. – Craig