K.Honda
K.Honda

Reputation: 3106

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.

Upvotes: 0

Views: 658

Answers (2)

Jonathan Grynspan
Jonathan Grynspan

Reputation: 43472

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

Upvotes: 0

Nick B
Nick B

Reputation: 1101

Make sure - (NSString *)cleanTitle:(NSString *)Title is also declared in your header file.

Upvotes: 3

Related Questions