我有我的应用程序的以下Info.plist,问题是我用扩展myapp保存的文件似乎没有拿起我从图标集创建的MyApp图标(应用程序正确使用图标)所以猜测有什么东西在plist中错了.
我假设如果我在某些时候运行我的应用程序时工作,我保存的文档会突然显示给定的图标.
如果这很重要,文档将从一组基于NSCoder的类中保存.单击这些文档也会打开我的应用程序并正确加载文件,因此混淆了我所缺少的文件中显示的图标....
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>myapp</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>MyApp</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>ASWM</string>
</array>
<key>CFBundleTypeName</key>
<string>MyApp project file</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>MyApp</string>
<key>CFBundleIdentifier</key>
<string>com.workmonkeys.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>ASWM</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 Me. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud) 我已经创建了一些代码来使用AV Foundation对mov文件进行屏幕捕获,我的下一步是记录Mac播放的声音,以便以后添加到录制的视频中.我做了一些挖掘,看起来我可能需要实现某种音频驱动程序来捕获音频.关于如何实现这一点的任何指针?
我假设以某种方式需要AudioUnit和IOKit ......
提前致谢.
我有一些显示窗口的代码......
- (IBAction)displayWindow:(id)sender
{
NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 50, 50) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
[window setBackgroundColor:[NSColor blackColor]];
[window setAlphaValue:.5];
[window setLevel:kShadyWindowLevel];
[window setReleasedWhenClosed:YES];
[window makeKeyAndOrderFront:self];
self.window = window;
}
Run Code Online (Sandbox Code Playgroud)
并关闭窗口....
- (IBAction)closeWindow:(id)sender
{
[self.window close];
}
Run Code Online (Sandbox Code Playgroud)
和窗口被定义为一个强大的属性......
@property (strong) NSWindow *window;
Run Code Online (Sandbox Code Playgroud)
代码第一次工作,但第二次显示窗口时......
self.window = window;
Run Code Online (Sandbox Code Playgroud)
与EXC_BAD_ACCESS崩溃...
我究竟做错了什么?
提前致谢....