Several UIAlertViews for a delegate

前端 未结 5 822
-上瘾入骨i
-上瘾入骨i 2020-12-13 13:21

Currently I\'ve got a class popping up UIAlertViews here and there. Currently, the same class is the delegate for these (it\'s very logical that it would be). U

5条回答
  •  一整个雨季
    2020-12-13 13:35

    FYI, if you want to target just iOS 4 users (which is reasonable now that ~98.5% of clients have at least iOS 4 installed), you should be able to use Blocks to do really nice inline handling of UIAlertViews.

    Here's a Stackoverflow question explaining it:
    Block for UIAlertViewDelegate

    I tried using Zachary Waldowski's BlocksKit framework for this. His UIAlertView(BlocksKit) API reference looked really good. However, I tried to follow his instructions to import the BlocksKit framework into my project, but unfortunately I couldn't get it to work.

    So, as Can Berk Güder suggests, I've used UIAlertView tags for now. But at some point in future I'm going to try to move to using Blocks (preferably one which supports ARC out of the box)!

提交回复
热议问题