으로 전송되었습니다. iDevice 프로그래밍을 배우려고합니다. 및 다른 타사 라이브러리와의 인터페이스에 사용되는 새로운 타사 라이브러리 사용법을 배우십시오. 프로젝트. 라이브러리는 아쉽게도 문서화가 잘되어 있지 않아 한 예제 프로그램의 작동 방식을 파악하는 데 어려움을 겪고 있습니다. 어떻게 작동하는지에 대한 내 팀의 두 가지 주요 이론은 "부두"와 "닌자 마술"입니다.+ [NSTimer timerWithTimeInterval : block : repeats :] : 인식 할 수없는 셀렉터가 클래스
필자는 새로운 기능의 프로젝트에 예제 애플리케이션을 전문적으로 보이게하기 위해 추가 된 모든 종소리와 호루라기의 일부가 아닌 핵심 기능의 일부인 것처럼 천천히 조각을 복사하고 그 (것)들을 일하기 위하여. 지금은이 오류를 받고 있어요 : *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSTimer timerWithTimeInterval:block:repeats:]: unrecognized selector sent to class 0x144e790'
, 여기에 재현 :
이@property (nonatomic) NSTimeInterval currentTime;
...
@synthesize currentTime;
// lots of other stuff that has nothing to do with Timers
-(void)setCurrentTime:(NSTimeInterval)time {
[self willChangeValueForKey:@"currentTime"];
currentTime = time;
[self didChangeValueForKey:@"currentTime"];
}
는 그 무엇을 찾고 선택 추가해야합니까?
편집 :. TC의 요청에
내가 도서관에서 그 방법을 찾고 가고, 자신의 파일이 발견 :
이#import <Foundation/Foundation.h>
/**
* A block based extension for NSTimer
*/
@interface NSTimer (EMAdditions)
/**
* Allows you set a block for execution when the timer fires.
* @param interval The time interval
* @param block The block to execute
* @param repeat A flag to indicate if the block should continuously repeat
*/
+(NSTimer *)timerWithTimeInterval:(NSTimeInterval)interval block:(void(^)(void))block repeats:(BOOL)repeat;
@end
나는이 액세스 할 수없는 라이브러리의 소스 코드 (그냥 큰 .a 파일)이지만이 메서드에 대한 구현이 있으면 안됩니까? 이 파일이있는 # import를 시도했지만 문제가 해결되지 않았습니다. [: 블록 : 반복 : NSTimer timerWithTimeInterval]
NSTimer에서 카테고리를 복사해야합니다. NSTimer는 아마도 라이브러리의 일부이기도합니다. "timerWithTimeInterval :"을 검색하면 도움이됩니다. –
@tc. 나는 이것을 선언하는 .h 파일을 발견했다. 카테고리를 어떻게 복사/추가 할 수 있을까? 라이브러리는 .h 파일과 .a 파일의 묶음입니다. 관련 .h 파일을 #imported했고 .a 파일을 빌드 프로세스에 포함 시켰습니다. 그 밖의 필요한 작업은 무엇입니까? –
링크 플래그에'-ObjC' 또는'-all_load'를 추가해야 할 수도 있습니다. –