Use to_s instead of UTF8String

This has the advantage of not causing a crash if the string object is nil.
This commit is contained in:
Allan Odgaard
2013-01-06 23:00:16 +01:00
parent d4f664d4c8
commit ad4bb59ba5

View File

@@ -394,8 +394,8 @@ void file_chooser_t::wait () const
@implementation FileChooserViewController
- (void)updateTitles
{
[sourceSelector setLabel:[NSString stringWithCxxString:path::display_name(fileChooser.projectPath.UTF8String)] forSegment:0];
[sourceSelector setLabel:[NSString stringWithCxxString:path::display_name(fileChooser.path.UTF8String)] forSegment:1];
[sourceSelector setLabel:[NSString stringWithCxxString:path::display_name(to_s(fileChooser.projectPath))] forSegment:0];
[sourceSelector setLabel:[NSString stringWithCxxString:path::display_name(to_s(fileChooser.path))] forSegment:1];
}
- (id)initWithFileChooser:(OakFileChooser*)chooser