在學習IOS微博開發的視頻資料,中間有兩個類編譯的時候,報錯,因OC粗淺,有點不明白。直接上代碼吧//CustomCatagory.h#import@interfaceUINavigationBar(setbackground)@end這是頭文件//CustomCatagory.m#import"CustomCatagory.h"@implementationUINavigationBar(setbackground)-(void)drawRect:(CGRect)rect{UIImage*image=[UIImageimageNamed:@"navbar_bg.png"];[imagedrawInRect:rect];}編譯的時候報錯:報錯Can'tfindinterfacedeclarationfor"UINavigationBar"其實我是不清楚為毛interface聲明的時候里面還可以帶一setbackground這是什么機制?求大神解讀。
報錯 Can't find interface declaration for "UINavigationBar"
拉莫斯之舞
2019-04-10 20:49:07