forum

Home / DeveloperSection / Forums / Block super class method to call sub-class

Block super class method to call sub-class

Anonymous User 1439 03-Nov-2015

I have some serious code in my app that make our apps superclass method dangerous, whenever I run the app it will hang in a loop in the context of the subclass. I know it is not a good work but I am a beginner in app development so I’ll take time to learn. I our code I need to either block that method form outside or throw an exception whenever it is called directly to the superclass, but still I am using it from sub-class, without caring it.
So, I want the best way to do it.
Here is the code that created problem on my app, In sub-class my override method is like this:

- (int) myMethod
{
  [NSException raise:@"HangingProblem!"

format:@"Do not use this method to call directly by the sub-class”];
  return nil;
}

Please give me the suggestions on my code to solve hanging issue.


Updated on 03-Nov-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By