开发者

How to subclass the NSObject while getting rid of -(id)init?

I want a class that take a REQUIRED argument开发者_StackOverflow社区 like the UITableViewController that does not have init.

Currently I just throw an exception when invoking init.

Is there a way to deactivate it completely?


No. Just redefine it to some error condition. This is bad style anyway and I question your motives.


A non-existant method (anywhere in the class hierarchy) for any object would cause the runtime to throw an exception. If that's what you mean by a deactivated method, and you're throwing an exception already, then you're already done.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜