2014-04-21 2 views
1

캐서프 레이어 타이틀을 설정하고 가져 오는 방법. 나는 아래에서하고있다. 여기 캐싱 테이프 레이어 제목

내 코드입니다 :

if(idx>1) 
     { 
      if (CGPathContainsPoint(path, &transform, point, 0)) { 


       [shapelayer setLineWidth:self.lineWidth+5]; 
       [shapelayer setStrokeColor:self.pointSelectedCircleColor.CGColor]; 

       NSString* title =shapelayer.name; 
       // NSLog(@"%@",shapelayer.name); 
      } else { 
       [shapelayer setZPosition:0]; 
       [shapelayer setLineWidth:self.circleWidth]; 
       [shapelayer setStrokeColor:self.pointCircleColor.CGColor]; 
      } 
     } 
    }]; 



    return title; 
+0

이 코드가 블록 내부에서 실행되는 것처럼 보이면 해당 답변을 참조하십시오. http://stackoverflow.com/q/20181708/1403732 http://stackoverflow.com/q/17642535/1403732 – sage444

답변

0

이 파하드를 시도

__block에있는 NSString * titleStr = @ "";

왜냐하면 모양 레이어 제목을 사용할 수 있기 때문입니다.