有没有办法确定工作表的状态?我知道我可以调用这个方法:
- (void) customSheetDidClose : (NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
但我想做的是这样的:
- (void) getInfoMethod {
//...do a lot of stuff to gather data
[self openSheetMethod:dictionaryFullOfStuff];
//I am completely making this up
while([panFileDataEditor state] == open) {
//do nothing
}
}
- (void) openSheetMethod : (NSDictionary*) stuff {
//...do something with stuff
[NSApp beginSheet: panFileDataEditor modalForWindow: window modalDelegate: self didEndSelector: @selector(customSheetDidClose:returnCode:contextInfo:) contextInfo: nil];
}
我正在为我的工作表使用 NSPanel,我想我可以获取它的框架并检查 y 位置以确定它的状态,但我想检查是否有可接受的方式来执行此操作......