2017-04-16 67 views
1

我使用橋接頭來使用JotUI框架,但我有一個問題。[UIImage circleBrushTexture]:無法識別的選擇器發送到類0x10a426a50

我從我的標題問題得到錯誤而罪魁禍首就是這個函數中:

- (JotSharedBrushTexture*)brushTexture { 
    JotGLContext* currContext = (JotGLContext*)[JotGLContext currentContext]; 
    if (!currContext) { 
     @throw [NSException exceptionWithName:@"NilGLContextException" reason:@"Cannot bind texture to nil gl context" userInfo:nil]; 
    } 
    if (![currContext isKindOfClass:[JotGLContext class]]) { 
     @throw [NSException exceptionWithName:@"JotGLContextException" reason:@"Current GL Context must be JotGLContext" userInfo:nil]; 
    } 
    JotSharedBrushTexture* texture = [currContext.contextProperties objectForKey:@"brushTexture"]; 
    if (!texture) { 
     // PROBLEM 
     NSLog(@"Creating a texture"); 
     texture = [[JotSharedBrushTexture alloc] initWithImage:[UIImage circleBrushTexture]]; 
     NSLog(@"After creating texture"); // doesn't log from here. 
     [currContext.contextProperties setObject:texture forKey:@"brushTexture"]; 
    } 
    return texture; 
} 

和被調用的函數:

+ (UIImage*)circleBrushTexture { 
    NSLog(@"HELLO"); 
    if (!circleBrush) { 
     UIGraphicsBeginImageContext(CGSizeMake(64, 64)); 
     CGContextRef defBrushTextureContext = UIGraphicsGetCurrentContext(); 
     UIGraphicsPushContext(defBrushTextureContext); 

     size_t num_locations = 3; 
     CGFloat locations[3] = {0.0, 0.2, 1.0}; 
     CGFloat components[12] = {1.0, 1.0, 1.0, 1.0, 
           1.0, 1.0, 1.0, 1.0, 
           1.0, 1.0, 1.0, 0.0}; 
     CGColorSpaceRef myColorspace = CGColorSpaceCreateDeviceRGB(); 
     CGGradientRef myGradient = CGGradientCreateWithColorComponents(myColorspace, components, locations, num_locations); 

     CGPoint myCentrePoint = CGPointMake(32, 32); 
     float myRadius = 30; 

     CGContextDrawRadialGradient(UIGraphicsGetCurrentContext(), myGradient, myCentrePoint, 
            0, myCentrePoint, myRadius, 
            kCGGradientDrawsAfterEndLocation); 

     CGGradientRelease(myGradient); 
     CGColorSpaceRelease(myColorspace); 

     UIGraphicsPopContext(); 

     circleBrush = UIGraphicsGetImageFromCurrentImageContext(); 

     UIGraphicsEndImageContext(); 
    } 

    return circleBrush; 
} 

不知道爲什麼發生這種情況。我嘗試在編譯源,乾淨的項目和編譯框架中刪除和聲名.m文件,但沒有任何結果。

回答

0

檢查,如果有circleBrushTexture方法文件選擇的目標是正確的(爲* .m文件)

+0

這會不會在編譯的源代碼,因爲我看到它有 –

+0

我不知道,是什麼你問關於 –

+0

當你從左側選擇源,在右側,你可以看到與檢查目標列表 –

相關問題