입니다. 앞에서 스프링 보드 프레임 워크를 사용하여 iOS7까지 잘 작동하는 프론트 엔드 앱을 얻었지만 iOS8에서는 제대로 작동합니다. 나는 프론트 엔드 앱 이름을 얻지 못하고있다. 이 코드를 사용하고 있습니다.FrontMost 앱을 얻는 방법 iOS8은
#define SBSERVPATH "/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices"
#define UIKITPATH "/System/Library/Framework/UIKit.framework/UIKit"
//To get port
mach_port_t *p;
void *uikit = dlopen(UIKITPATH, RTLD_LAZY);
int (*SBSSpringBoardServerPort)() =
dlsym(uikit, "SBSSpringBoardServerPort");
p = (mach_port_t *)SBSSpringBoardServerPort();
dlclose(uikit);
void *sbserv = dlopen(SBSERVPATH, RTLD_LAZY);
void* (*SBFrontmostApplicationDisplayIdentifier)(mach_port_t* port,char * result) =
dlsym(sbserv, "SBFrontmostApplicationDisplayIdentifier");
//Get frontmost application
char frontmostAppS[256];
memset(frontmostAppS,sizeof(frontmostAppS),0);
SBFrontmostApplicationDisplayIdentifier(p,frontmostAppS);
NSString * frontmostApp=[NSString stringWithFormat:@"%s",frontmostAppS];
아무도 도와 주실 수 있습니까? 또는 내가 실수 한 부분은 빛을 추가 할 수 있습니다. 미리 감사드립니다.
ios 8에 대한 해결책이 있습니까? – Bittu