i want to reload ViewdidLoad in a method But now want to call again like [self viewDidLoad ];
is this possible?
Instead of calling viewDidLoad:
make another method (newMethod
) and move all the code in it that needs to be called then from
- (void)viewDidLoad{
[super viewDidLoad];
[self newMethod];
}
Then from your code where you want to call viewDidLoad:
call
[self newMethod];
func viewDidLoad() {
super.viewDidLoad()
self.newMethod()
}
Then from your code where you want to call viewDidLoad:
call
self.newMethod()
Copy all code in - (void)viewDidLoad then paste in viewWillAppear
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
//paste your viewDidLoad codes
}
Yes you can call from any method but if you post your scenario then it is better to reply
[self viewDidLoad];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With