Fire and Forget Class in ARC

I needed to create a custom one UIAlertViewfor my application, and I came across this article describing how to do this. Iโ€™ve made a few changes since then, but itโ€™s all the more important that this class does not work as a โ€œFire and Forgetโ€ warning, as it does UIAlertView, because ARC does not allow naming retain.

So basically, I want to be able to use my custom alert view in the same way as the normal alert view, so I can create and display it like this:

CustomAlertView *alert = [[CustomAlertView alloc] init];//Init presumably does the view setup
[alert show];

So my question is: how can I make this object not freed up as soon as it leaves the scope when working in an ARC project without creating a link strongto it in the calling class?

EDIT

I believe it is important to note that in order to get the full freedom of customization that I wanted, I had to make it a new ViewController class, it is NOT a subclassUIAlertView

EDIT 2

Sorry, I didnโ€™t look at my link too closely, initially I had the wrong textbook. THIS is the right study guide. I based my opinion on

+5
source share
2 answers

UIAlertView, UIWindow, [window makeKeyAndVisible]. , , . , .

, , .

.. customalertview UIWindow, UIWindow subview: customalertview. , UIWindow, .

+1

, . , , ( ) , - .

0

All Articles