• 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
Modal sheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modal sheet


  • Subject: Modal sheet
  • From: Hamish Allan <email@hidden>
  • Date: Fri, 11 Mar 2005 03:32:27 +0000

Hi,

I'm getting the following errors trying to open a modal sheet:

2005-03-11 03:03:52.747 BeatLabel[10216] startProgress: Metanome: etco Prelude 1.mp3
2005-03-11 03:03:52.774 BeatLabel[10216] *** Assertion failure in -[NSApplication _commonBeginModalSessionForWindow:relativeToWindow:modalDelegate: didEndSelector:contextInfo:], AppKit.subproj/NSApplication.m:2763
2005-03-11 03:03:52.805 BeatLabel[10216] *** NSRunLoop ignoring exception 'NSInternalInconsistencyException' (reason 'Modal session requires modal window') that raised during posting of delayed perform with target 387e40 and selector 'startDecoding:'


What I'm trying to do is make a sheet to pop up on a document's window immediately after it first appears (to indicate progress decoding MP3 data into PCM). Therefore I have in my document class:

- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)type
{
	myFileData = [data retain];
	[self performSelector:@selector(startDecoding:)
		withObject:type afterDelay:0];
    return YES;
}

- (void)startDecoding:(id)userData
{
	[myWindowController startProgress:
		[@"Decoding " stringByAppendingString: (NSString *)userData]];
	[NSThread detachNewThreadSelector: @selector(doDecoding:)
		toTarget:self withObject:userData];
}

[...]

and in my controller class:

- (void)startProgress:(NSString *)message
{
	NSLog(@"startProgress: %@", [[self window] title]);

	[progressSheetInfo setStringValue: message];
	myCancelProgressFlag = FALSE;
	[progressSheetBar setIndeterminate:YES];
	[progressSheetBar startAnimation:self];
	[NSApp beginSheet:progressSheet
           modalForWindow:[self window]
           modalDelegate:nil
           didEndSelector:nil
           contextInfo:nil];

	NSLog(@"End startProgress");
}

As evidenced by the log, the controller's window outlet has been set up correctly. What else might I be missing?

Thanks,
Hamish

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: NSGLImage doesnt open large images
  • Next by Date: Solved: Modal NSWindow
  • Previous by thread: Solved: Modal NSWindow
  • Next by thread: Fwd: Modal sheet
  • Index(es):
    • Date
    • Thread