-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtils.m
More file actions
34 lines (29 loc) · 954 Bytes
/
Utils.m
File metadata and controls
34 lines (29 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// Utils.m
// ClangFormatForXcode
//
// Created by Tareq A. Siraj on 12/14/2013.
// Copyright (c) 2013 Tareq A. Siraj. All rights reserved.
//
#import "Utils.h"
@implementation Utils
#pragma mark Class methods
+ (void)alert:(NSString *)msg {
[[NSAlert alertWithMessageText:msg
defaultButton:nil
alternateButton:nil
otherButton:nil
informativeTextWithFormat:@""] runModal];
}
+ (void)alertWithError:(NSError *)error {
[[NSAlert alertWithError:error] runModal];
}
+ (NSError *)createError:(NSString *)errorStr withErrorCode:(NSInteger)code {
NSMutableDictionary *errorDetails = [NSMutableDictionary dictionary];
[errorDetails setValue:errorStr forKey:NSLocalizedDescriptionKey];
return [NSError errorWithDomain:ERROR_DOMAIN code:code userInfo:errorDetails];
}
+ (NSError *)createError:(NSString *)errorStr {
return [Utils createError:errorStr withErrorCode:1];
}
@end