Creating a class with no init method (Objective-c) -
Is it possible to create a class with any init method, so that all the callers make a factory method instead of the object To be compelled?
So basically, you want to make sure that anytime you use your class-int Not started, is not it? You can not exactly do what you want to do, but you can come close.
Since you get from NSObject, you have an init method and you can not do anything to stop it from being called, he said, you can override the init for this:
- (id) init {[self dealloc]; @throw [NSE Exception exception: Alias: @ "MyexationName" Reason: @ "Reason" userInfo: zero]; Return zero; }
In this way, sometimes a person calls your method, kills the object, so speaking practically, your init method is very much unwritten.
Comments
Post a Comment