How do i refer to methods inside a UIVIiw?
I have imported my .h file into a 2nd one, but in the 2nd one i'm trying to do:
FirstClass *firstClass = [FirstClass alloc] init];
[firstClass iconWithType:test];
To match this:
-(void)iconWithType:(NSString *)iconType
But it's not listing iconWithType as a 开发者_开发技巧suggestion and i get a warning saying it might not respond to that.
How can i get this to work properly?
My FirstClass is a UIView.
In your FirstClass.h file do you have the method definition in the interface
?
I.e.
@interface FirstClass : NSObject {
}
- (void)iconWithType:(NSString *)iconType;
@end
Additionally, the name of the method implies something should be returned. However, it is marked as void.
I'm guessing you just have a return type mismatch. Take a look: does -iconWithType:
actually return void
? or does it return a UIImage
or something else besides?
精彩评论