X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=osx.m;h=47401241757a1b1b275e458866d1786c8d27be3d;hb=fa64ed3e875e005452e5ecd639bd1d6099387bd7;hp=13abc4ee5590e136eb720d675ba5b481b6d47f84;hpb=eda5a867872e718b62ea52373ec9f44aa0c3bda2;p=sgt-puzzles.git diff --git a/osx.m b/osx.m index 13abc4e..4740124 100644 --- a/osx.m +++ b/osx.m @@ -569,7 +569,7 @@ struct frontend { [status setBezeled:YES]; [status setBezelStyle:NSTextFieldSquareBezel]; [status setDrawsBackground:YES]; - [[status cell] setTitle:@""]; + [[status cell] setTitle:@DEFAULT_STATUSBAR_TEXT]; [status sizeToFit]; rect2 = [status frame]; rect.size.height += rect2.size.height; @@ -761,7 +761,24 @@ struct frontend { [op setAllowsMultipleSelection:NO]; if ([op runModalForTypes:nil] == NSOKButton) { - const char *name = [[[op filenames] objectAtIndex:0] cString]; + /* + * This used to be + * + * [[[op filenames] objectAtIndex:0] cString] + * + * but the plain cString method became deprecated and Xcode 7 + * started complaining about it. Since OS X 10.9 we can + * apparently use the more modern API + * + * [[[op URLs] objectAtIndex:0] fileSystemRepresentation] + * + * but the alternative below still compiles with Xcode 7 and + * is a bit more backwards compatible, so I'll try it for the + * moment. + */ + const char *name = [[[op filenames] objectAtIndex:0] + cStringUsingEncoding: + [NSString defaultCStringEncoding]]; char *err; FILE *fp = fopen(name, "r");