我的其他程序员从网上下载这段代码
#import "UIImage+Alpha.h" // Private helper methods @interface UIImage () - (CGImageRef)newBorderMask:(NSUInteger)borderSize size:(CGSize)size; @end @implementation UIImage (Alpha)
我有错误:
什么原因是Category正在实现一个也将由其主类实现的方法?
我在整个文件中搜索newBorderMask,该单词只显示3次.
这只是宣布一次
@interface UIImage () - (CGImageRef)newBorderMask:(NSUInteger)borderSize size:(CGSize)size; @end
执行一次即可
#pragma mark - #pragma mark Private helper methods // Creates a mask that makes the outer edges transparent and everything else opaque // The size must include the entire mask (opaque part + transparent border) // The caller is responsible for releasing the returned reference by calling CGImageRelease - (CGImageRef)newBorderMask:(NSUInteger)borderSize size:(CGSize)size1 { CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
并呼吁一次
CGImageRef maskImageRef = [self newBorderMask:borderSize size:newRect.size];
所以没有双重的声明.
所以有什么问题.
解决方法
原文地址:https://www.jb51.cc/c/112349.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。