我在单个 .h 文件中有两个 @interface。我想在辅助 @interface 中访问一个方法。
我的头文件的名字是MyImage.h
@interface MyImage : NSObject
- (void)addImage:(UIImage *)image forName:(NSString*)fileName;
- (void)clearImageCache;
@end
@interface UIImageView (URL_Loading)
- (void)setImageWithURL:(NSURL *)url;
- (void)setImageWithURL:(NSURL *)url
placeholderAsSpinner:(BOOL)spinnerEnabled;
@end
谁能告诉我如何调用 setImageWithURL: 方法
最佳答案
@interface UIImageView (URL_Loading)
是 UIImageView
的一个类别,因此它添加了 2 个新方法。
导入 header
并在 UIImageView
中调用它
例子:
[yourImageView setImageWithURL:url];
关于ios - 如何在.h 文件中的辅助@interface 中调用方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29652515/