Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (32 sloc) 0.771 kB
//
// UIAlertViewDelegate.m
// Marshmallows
//
// Created by Sami Samhuri on 11-09-05.
// Copyright 2011 Sami Samhuri. All rights reserved.
//
#import "UIAlertViewDelegate.h"
@implementation UIAlertViewDelegate
+ (id) alertViewDelegateWithCallback: (UIAlertViewCallback)callback
{
return [[[self alloc] initWithCallback: callback] autorelease];
}
- (id) initWithCallback: (UIAlertViewCallback)callback
{
self = [super init];
if (self) {
_callback = Block_copy(callback);
}
return self;
}
- (void) alertView: (UIAlertView *)alertView clickedButtonAtIndex: (NSInteger)buttonIndex
{
BOOL canceled = (buttonIndex == 0);
_callback(buttonIndex, canceled);
}
- (void) dealloc
{
[_callback release];
[super dealloc];
}
@end
Jump to Line
Something went wrong with that request. Please try again.