方法“-cleanTitle”。未找到(返回类型默认为“id”)
我正在尝试在我的应用程序中实现 RSS feed,并且我创建了一种方法来清理标题。
- (NSString *)cleanTitle:(NSString *)Title {
return [Title stringByReplacingOccurrencesOfString:@"twitterfeed: " withString:@""];
}
警告出现在下面的 articleTitle
行上:
- (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"]];
你知道如何消除此警告吗?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保
- (NSString *)cleanTitle:(NSString *)Title
也在头文件中声明。Make sure
- (NSString *)cleanTitle:(NSString *)Title
is also declared in your header file.如果两个方法不属于同一类别或类,则在使用该方法之前必须知道该方法的签名。如果它是同一个类,但
-cleanTitle:
位于(Private)
类别或类似类别中,请务必在类的实现之前声明该类别(在您的 . m 文件):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) :