저는 iPhone 개발에 멍청한 사람이고 유리 단추 (found here)를 구현하는 동안 이상한 문제가 있습니다. MOGlassButtons.m 파일 안에 "unexpected in @ program error"가 생기기 때문에 빌드가 실패합니다. 이 문제를 해결하는 방법에 관해서는 아무 것도 찾을 수 없었습니다. 어떤 도움이라도 대단히 감사합니다.유리 단추 UIButton 구현 문제
MOGlassButton.m
self.gradientLayer1.colors = @[(id)[MO_RGBACOLOR(255, 255, 255, 0.45) CGColor], (id)[MO_RGBACOLOR(255, 235, 255, 0.1) CGColor]]; //<--"unexpected @ in program error"
self.gradientLayer2.colors = @[(id)[MO_RGBACOLOR(205, 205, 205, 0) CGColor], (id)[MO_RGBACOLOR(235, 215, 215, 0.2) CGColor]]; //<--"unexpected @ in program error"
편집
#import "MOGlassButton.h"
// Courtesy of https://github.com/facebook/three20
#ifndef MO_RGBCOLOR
#define MO_RGBCOLOR(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1]
#endif
#ifndef MO_RGBCOLOR1
#define MO_RGBCOLOR1(c) [UIColor colorWithRed:c/255.0 green:c/255.0 blue:c/255.0 alpha:1]
#endif
#ifndef MO_RGBACOLOR
#define MO_RGBACOLOR(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#endif
MO_RGBACOLOR을 표시해주세요. 만약 내가 생각하기에, 매크로라면, 가능성은 그 원인이다. –
@JuliusMaximilianSteen 제 편집을 확인하십시오 –
CGColorRef를 ID로 전송할 수 없습니다. UIColor를 저장 하시겠습니까? –