이것은 내 첫 번째 질문은 stackoverflow.com입니다. AppDelegate.m의 ViewController.m에서 [- (void) alterTime] 메서드를 호출하려고합니다. 예, # import "ViewController.h"AppDelegate.h 있습니다. 컨트롤러를 AppDelegate.m으로 가져 오면 아무런 차이가 없습니다. 또한 "배경 가져 오기"가 켜져 있습니다.AppViewController 메서드에서 AppDelegate
[mainViewController alterTime];
그것은 상태 :이 코드의 조각을 나에게주는 문제가
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
{
NSLog(@"Current Time Altered");
//Get current view controller
ViewController *mainViewController = (ViewController *)self.window.rootViewController;
[mainViewController alterTime];
//Cleanup
completionHandler(UIBackgroundFetchResultNewData);
}
: 여기
내가 구현하기 위해 노력하고있어 AppDelegate.m 내부의 코드 없다 "눈에 띄는 'ViewController'의 @interface는 selector 'alterTime' "을 선언합니다.
쇼'ViewController.h' –