• 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
Re: Opening/Saving files via Sheets...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening/Saving files via Sheets...


  • Subject: Re: Opening/Saving files via Sheets...
  • From: Steven Canfield <email@hidden>
  • Date: Sat, 08 Dec 2001 18:27:12 -0600

On 12/8/01 6:07 PM, "John Hvrnkvist" <email@hidden> wrote:

>
> On Sunday, December 9, 2001, at 12:38 , Steven Canfield wrote:
>
>> On 12/8/01 4:37 PM, "John Hvrnkvist" <email@hidden>
>> wrote:
>>
>>> On Saturday, December 8, 2001, at 11:20 , Steven Canfield wrote:
>>>>
>>>>
>>>> myPanel = [NSOpenPanel beginSheetForDirectory:NSHomeDirectory()
>>>>
>>>> "2001-12-08 15:57:14.298 Nimage[744] *** +[NSOpenPanel
>>>>
beginSheetForDirectory:file:type:modalForWindow:modalDelegate:didEndSelecto>>>>
r
>>>> :contextInfo:]: selector not recognized"
>>>
>>> beginSheetForDirectory is an instance method, not a class method.
>>> myPanel=[NSOpenPanel openPanel];
>>> [myPanel beginSheetForDirectory:NSHomeDirectory()
>>> file:nil
>>> type:fileTypes
>>> modalForWindow:myWindow
>>> modalDelegate:self
>>> didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
>>> contextInfo:sender];
>>>
>>> Regards.
>>> John Hornkvist
>>> --
>>> ToastedMarshmallow, the perfect Cocoa companion
>>> http://www.toastedmarshmallow.com
>>> _______________________________________________
>>> 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.
>>
>>
>> Ok, I fixed it so that it matches what you've got..
>> Now, it still generates the same runtime thing, but, the warnings pb
>> gives
>> me are different.
>
>> 'myDelagate.m:15: warning: `NSPanel' does not respond to
>> `beginSheetForDirectory:file:type:modalForWindow:modalDelegate:didEndSelecto
>> r:contextInfo:'
>>
>
>> myDelagate.m:23: warning: `NSPanel' does not respond to `filenames'
>>
>
> MyPanel should be an NSOpenPanel.
>
> There's a lot of fishy stuff in your code, though.
>
>
> - (IBAction)openPic:(NSWindow *)sender
> {
> NSArray *fileTypes = [NSArray arrayWithObjects: @"jpg", @"gif", @"tiff"
> @"bmp", @"ping", @"pict", @"pdf", @"eps", nil]; // Fine
> NSWindow *myWindow; // Bad! You need to attach that sheet to some
> existing window. What you're doing here can cause a crash.
>
> [[NSOpenPanel openPanel] beginSheetForDirectory:NSHomeDirectory()
> file:nil
> type:fileTypes
> modalForWindow:myWindow // Wrong! You need a pointer to an existing
> window.
> modalDelegate:self
> didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
> contextInfo:sender];
> return FALSE;
> }
>
> - (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode
> contextInfo:(void *)contextInfo{
> {
> NSArray *myArray;
> if(returnCode == NSOKButton)
> myArray = [sheet filenames]; // Don't use "myPanel", use sheet
> }
> }
>
> Regards,
> John Hornkvist
> --
> ToastedMarshmallow, the perfect Cocoa companion
> http://www.toastedmarshmallow.com
>

Well then.. Interesting!
I fixed my code, one more problem..
How in the monkeystuff do I refer to a window? I tried changing the "name"
attribute to "aWindow" and then tried to refer to it thus...
No luck. Error.
Thanks in advance,
--
Stevos
Realbasic developer extraordinaire


  • Prev by Date: Project Builder Build Bug
  • Next by Date: Re: Opening/Saving files via Sheets...
  • Previous by thread: Re: Opening/Saving files via Sheets...
  • Next by thread: Re: Opening/Saving files via Sheets...
  • Index(es):
    • Date
    • Thread