Z
Z
Zaur Abdulgalimov2014-09-09 17:49:38
Objective-C
Zaur Abdulgalimov, 2014-09-09 17:49:38

How to change UIApplicationDelegate listener?

I want to make sure that an instance of my class receives UIApplicationDelegate calls. Created a class:

@interface MyClass : NSObject <UIApplicationDelegate> {
...
}

And I'm trying to change the delegate:
MyClass *myClass = [[MyClass alloc] init];
[[UIApplication sharedApplication] setDelegate:myClass];

This is where the app crashes. What am I doing wrong?
Thank you.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
D
Denis Morozov, 2014-09-09
@morozovdenis

there are two ways:
one: you already have the required class, usually called AppDelegate
two: notifications

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question