如何让应用程序名称在前台运行?它在iOS 7中使用SpringBoard,但在iOS 8中我没有得到结果.任何帮助表示赞赏.我不需要在苹果商店提交我的应用程序,所以如果还有任何补丁或脚本,请告诉我.
代码在iOS 8.0以下正常运行
- (NSMutableString*) getActiveApps
{
mach_port_t *port;
void *lib = dlopen(SBSERVPATH, RTLD_LAZY);
int (*SBSSpringBoardServerPort)() =
dlsym(lib, "SBSSpringBoardServerPort");
port = (mach_port_t *)SBSSpringBoardServerPort();
dlclose(lib);
//mach_port_t * port = [self getSpringBoardPort];
// open springboard lib
//void *lib = dlopen(SBSERVPATH, RTLD_LAZY);
// retrieve function SBFrontmostApplicationDisplayIdentifier
void *(*SBFrontmostApplicationDisplayIdentifier)(mach_port_t *port, char *result) =
dlsym(lib, "SBFrontmostApplicationDisplayIdentifier");
// reserve memory for name
char appId[256];
memset(appId, 0, sizeof(appId));
// retrieve front app name
SBFrontmostApplicationDisplayIdentifier(port, appId);
// close dynlib
dlclose(lib);
return [[NSString stringWithFormat:@"%s", appId] retain];
} …Run Code Online (Sandbox Code Playgroud) 我必须添加截图到我的OSX应用程序的能力,但Apple演示只给我整个屏幕图像,我只想要我的应用程序窗口图像.
我的代码是:
NSInteger displaysIndex = 0;
if(displays != nil)
{
free(displays);
}
CGError err = CGDisplayNoErr;
CGDisplayCount dspCount = 0;
/* How many active displays do we have? */
err = CGGetActiveDisplayList(0, NULL, &dspCount);
/* If we are getting an error here then their won't be much to display. */
if(err != CGDisplayNoErr)
{
return;
}
/* Allocate enough memory to hold all the display IDs we have. */
displays = calloc((size_t)dspCount, sizeof(CGDirectDisplayID));
// Get the list of active displays …Run Code Online (Sandbox Code Playgroud) 我有一个听诊器数字机设备,所以我将该机器与 PC 相连并使用 C++ 代码(算法)获取该机器数据,那么我该如何开始?任何人都可以给我任何类型的教程或任何相关示例链接来帮助我完成该任务吗?我对此类任务了解不多,因此与该任务相关的对我有好处的内容请建议我。