我在 [exporter exportAsynchronouslyWithCompletionHandler:^{ 的 Thread 中要呼叫 main thread 的函數,
我在主 Thread 中有一個程式:
代碼:
-(void) songReady: (NSInteger) nIndex { NSLog(*"Song Ready : %d",nIndex); }
代碼:
[selfperformSelectorOnMainThread:*selector(songReady) withObject:[NSNumbernumberWithInt : i] waitUntilDone:NO];
2012-04-14 11:29:34.629 DLNAServer[177:240f] AVAssetExportSessionStatusCompleted
2012-04-14 11:29:34.634 DLNAServer[177:707] -[MusicViewController songReady]: unrecognized selector sent to instance 0x2a64a0
2012-04-14 11:29:34.642 DLNAServer[177:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MusicViewController songReady]: unrecognized selector sent to instance 0x2a64a0'
*** First throw call stack:
(0x34eda88f 0x36ea8259 0x34edda9b 0x34edc915 0x34e37650 0x34e391fb 0x33726747 0x34eaead3 0x34eae29f 0x34ead045 0x34e304a5 0x34e3036d 0x3449b439 0x314a7e7d 0x99a03 0x999a8)
可否請教是不是我什麼地方做的不對嗎?
我爬文之後,看到的回覆,也都是建議這樣使用。
謝謝您。
收到通知後聲音變小聲
6 天前 進 iPhone 疑難雜症發問區