Method '-cleanTitle.' not found (return type defaults to 'id')
I'm trying to implement an rss feed into my app and I have created a method to clean the title up.
- (NSString *)cleanTitle:(NSString *)Title {
return [Title stringByReplacingOccurrencesOfString:@"twitterfeed: " withString:@""];
}
The warning occurs on the 开发者_如何学运维articleTitle
line below:
- (void)parseAtom:(GDataXMLElement *)rootElement entries:(NSMutableArray *)entries {
NSString *blogTitle = [rootElement valueForChild:@"title"];
NSArray *items = [rootElement elementsForName:@"entry"];
for (GDataXMLElement *item in items) {
NSString *articleTitle = [self cleanTitle: [item valueForChild:@"title"]];
Do you know how to get rid of this warning?
Thanks.
Make sure - (NSString *)cleanTitle:(NSString *)Title
is also declared in your header file.
The method's signature must be known before it is used if the two methods are not in the same category or class. If it's the same class but -cleanTitle:
is in a (Private)
category or some such, be sure to declare that category prior to your class' implementation (in your .m file) :
@interface MyClass (Private)
- (NSString *)cleanTitle: (NSString *)title;
@end
精彩评论