Files
RestKit/Code/Support/RKAlert.m
Blake Watters 9593612aab Closes gh-47. Initial implementation of OS X build integrating changes submitted by Felix Holmgren (https://github.com/Felixyz/RestKit).
* Factored out display of alerts into RKAlert interface that hides the differences between UIKit and OS X Cocoa.
* Added macosx to supported platforms to enable build on OS X.
* Configured project to use conditional architectures to enable building on OS X and iOS from the same targets.
* Implemented a bare-bones OS X example app.
* Create `rake build` task for building RestKit against iOS and OS X SDK for quick testing.
2011-04-12 21:02:25 -04:00

39 lines
1.0 KiB
Objective-C

//
// RKAlert.m
// RestKit
//
// Created by Blake Watters on 4/10/11.
// Copyright 2011 Two Toasters. All rights reserved.
//
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <AppKit/AppKit.h>
#endif
#import "RKAlert.h"
void RKAlert(NSString* message) {
RKAlertWithTitle(message, @"Alert");
}
void RKAlertWithTitle(NSString* message, NSString* title) {
#if TARGET_OS_IPHONE
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:title
message:message
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", nil)
otherButtonTitles:nil];
[alertView show];
[alertView release];
#else
NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:message];
[alert setInformativeText:message];
[alert addButtonWithTitle:NSLocalizedString(@"OK", nil)];
[alert runModal];
[alert release];
#endif
}