• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[anOpenPanel filename] won't work after XCode 1.1 update
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[anOpenPanel filename] won't work after XCode 1.1 update


  • Subject: [anOpenPanel filename] won't work after XCode 1.1 update
  • From: Fernando Santos <email@hidden>
  • Date: Sun, 21 Dec 2003 22:52:46 -0200

Hey guys,
I'm writing an app that edits HTML and JavaScript files and it's got a
feature that creates projects with template files. It worked fine until
I updated to Mac OS 10.3.2 and XCode 1.1 yesterday.
Here is the code I've been working on: (I didn't have much time so I
added some comments to the code)

- (IBAction)criarProjeto:(id)sender
{
// Creates an Open Panel
NSOpenPanel *painelAbrir;
painelAbrir = [[NSOpenPanel alloc] init];
[painelAbrir setTitle:@"Escolha um Diretsrio"];
[painelAbrir setCanChooseDirectories:YES];
[painelAbrir setCanCreateDirectories:YES];
[painelAbrir setCanChooseFiles:NO];
// Alert - Checks if user pressed OK Button on the Open panel
if([painelAbrir runModalForTypes:nil] == NSOKButton)
{
NSString *path;
path = [painelAbrir filename]; // Here lies all my suffering
NSString *pathFinal;
pathFinal = [path stringByAppendingPathComponent:@"Projeto"];
// path and pathFinal strings won't return anything even outside the
"if"s
NSAlert *alerta = [[NSAlert alloc] init];
[alerta addButtonWithTitle:@"OK"];
[alerta addButtonWithTitle:@"Cancelar"];
[alerta setMessageText:@"Criar Projeto?"];
[alerta setInformativeText:@"O Projeto sera criado no diretsrio
escolhido. Deseja continuar?"];
[alerta setAlertStyle:NSWarningAlertStyle];
if ([alerta runModal] == NSOKButton) {
// OK
// Create the folder inside the path chosen by the user
[[NSFileManager defaultManager] createDirectoryAtPath:pathFinal
attributes:nil];
}
[alerta release];
}
}

This is not working properly. All the alerts show up and the open panel
works the way it should, except by the fact that [painelAbrir filename]
does not return anything.
Is there something wrong? And if there is, why did it work in XCode
1.0.1 ?
Thank you.

======================================
Fernando Lucas
Estudante
Programador
Designer Grafico
eMail : email@hidden
iModz : http://www.macmagazine.com.br/imodz/
VisualSome: http://nandolucas.deviantart.com/gallery/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: with java - create, read from, write to preferences file
  • Next by Date: NSAssert question
  • Previous by thread: Re: Adding "Bindings"
  • Next by thread: NSAssert question
  • Index(es):
    • Date
    • Thread