1
0
mirror of https://github.com/thes3m/XNI synced 2024-12-26 13:26:06 +01:00
XNI/Classes/Retronator/Xni/Framework/GamerServices/XniShowMessageBoxResult.m

53 lines
1009 B
Mathematica
Raw Normal View History

//
// XniShowMessageBoxResult.m
// XNI
//
// Created by Matej Jan on 23.2.11.
// Copyright 2011 Retronator. All rights reserved.
//
#import "XniShowMessageBoxResult.h"
@implementation XniShowMessageBoxResult
- (id) initWithAsyncState:(id)theAsyncState callback:(Delegate*)theCallback
{
self = [super init];
if (self != nil) {
asyncState = [theAsyncState retain];
callback = [theCallback retain];
// Lock the lock until the alert returns.
asyncLock = [[NSLock alloc] init];
[asyncLock lock];
}
return self;
}
@synthesize asyncState, asyncLock, isCompleted, result;
- (BOOL) completedSynchronously {
return NO;
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
[asyncLock unlock];
isCompleted = YES;
result = [[NSNumber alloc] initWithInteger:buttonIndex];
[callback invokeWithArgument:self];
}
- (void) dealloc
{
[asyncState release];
[callback release];
[asyncLock release];
[result release];
[super dealloc];
}
@end