开发者

Objective-C casting

I'm trying to cast this statement:

[self handError:noConnectionError];

basically, 开发者_StackOverflowthis statement is in a class, which is not the app delegate, but is the .m file of a view, specifically a view after uitableview, which contains its own uiviewtable.

The warning that statement gives me is that the error produced may not be apparent to the UIView (view control container).


That's the objective-c compiler telling you that the method is not declared in the interface for the class. Add the method declaration to the .h file and the warning should go away.

Also, if you want the method to be private, you can extend the interface in the .m file with a category like

@interface NTItemList (PrivateMethods)
 - (void)handleError:(NSError *)error;
@end

This has the added benifit of not cluttering your class declaration.


This has nothing to do with casting as far as I can tell. It would appear that your class does not implement handleError:, which is required if you want to send it that message.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜