Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Use NSUInteger instead of NSInteger for the return code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Abizern committed Mar 6, 2011
1 parent a2afffa commit 273b5ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions JCSSheetController.h
Expand Up @@ -10,7 +10,7 @@

#import <Cocoa/Cocoa.h>

typedef void (^JCSCompletionHandler)(NSInteger result);
typedef void (^JCSCompletionHandler)(NSUInteger result);

@interface JCSSheetController : NSWindowController {
@private
Expand All @@ -21,7 +21,7 @@ typedef void (^JCSCompletionHandler)(NSInteger result);
- (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(JCSCompletionHandler)aHandler;

// Convenience methods for subclasses to use
- (void)endSheetWithReturnCode:(NSInteger)result;
- (void)endSheetWithReturnCode:(NSUInteger)result;
- (void)sheetWillDisplay; // Default does nothing

@end
6 changes: 3 additions & 3 deletions JCSSheetController.m
Expand Up @@ -8,7 +8,7 @@
#import "JCSSheetController.h"

@interface JCSSheetController ()
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSUInteger)returnCode contextInfo:(void *)contextInfo;
@end

@implementation JCSSheetController
Expand All @@ -23,7 +23,7 @@ - (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(JCSComple
[NSApp beginSheet:self.window modalForWindow:window modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:NULL];
}

- (void)endSheetWithReturnCode:(NSInteger)result {
- (void)endSheetWithReturnCode:(NSUInteger)result {
[NSApp endSheet:[self window] returnCode:result];
}

Expand All @@ -35,7 +35,7 @@ - (void)sheetWillDisplay {
// Mark: -
// Mark: Class Extension methods

- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSUInteger)returnCode contextInfo:(void *)contextInfo {
[sheet orderOut:self];

if (self.handler) {
Expand Down
2 changes: 1 addition & 1 deletion JCSSheetController_Example/AppDelegate.m
Expand Up @@ -29,7 +29,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification

- (void)showSheet:(id)sender {
NSLog(@"Button clicked");
[sheetController beginSheetModalForWindow:self.window completionHandler:^(NSInteger returnCode) {
[sheetController beginSheetModalForWindow:self.window completionHandler:^(NSUInteger returnCode) {
if (returnCode == kSheetReturnedOk) {
self.displayString = kOkString;
} else if (returnCode == kSheetReturnedCancel) {
Expand Down

0 comments on commit 273b5ac

Please sign in to comment.