Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ tvOS istream故障_C++_Swift_Tvos - Fatal编程技术网

C++ tvOS istream故障

C++ tvOS istream故障,c++,swift,tvos,C++,Swift,Tvos,我正在尝试在tvOS上运行,但每次它尝试加载其数据库或游戏文件时,它都会停在这里 void In::SafeRead(byte* data,dword size) { static_cast<std::istream*>(stream)->read( reinterpret_cast<char*>(data), size); } 同样的代码在iOS上运行良好 谢谢大家!

我正在尝试在tvOS上运行,但每次它尝试加载其数据库或游戏文件时,它都会停在这里

void In::SafeRead(byte* data,dword size) {
    static_cast<std::istream*>(stream)->read( reinterpret_cast<char*>(data), size);
}
同样的代码在iOS上运行良好


谢谢大家!class ViewController: UIViewController { let emuWidth: CGFloat = 341.0 let emuHeight: CGFloat = 320.0 var emulatorCore: EmulatorCore! var emulatorView: ScreenView! override func viewDidLoad() { super.viewDidLoad() self.emulatorView = ScreenView(frame: CGRectMake(0, 0, emuWidth, emuHeight)) self.emulatorView.backgroundColor = UIColor.blackColor() self.view.addSubview(self.emulatorView) self.emulatorCore = EmulatorCore() self.emulatorCore.initializeEmulator() self.emulatorCore.frameBufferSize = CGSizeMake(emuWidth, emuHeight) do { let fileManager = NSFileManager.defaultManager() if !fileManager.fileExistsAtPath((NSTemporaryDirectory() as NSString).stringByAppendingPathComponent("NstDatabase.dat")) { try NSFileManager.defaultManager().copyItemAtPath(NSBundle.mainBundle().pathForResource("NstDatabase", ofType: "dat")!, toPath: (NSTemporaryDirectory() as NSString).stringByAppendingPathComponent("NstDatabase.dat")) } if !fileManager.fileExistsAtPath((NSTemporaryDirectory() as NSString).stringByAppendingPathComponent("mega_man.nes")) { try NSFileManager.defaultManager().copyItemAtPath(NSBundle.mainBundle().pathForResource("mega_man", ofType: "nes")!, toPath: (NSTemporaryDirectory() as NSString).stringByAppendingPathComponent("mega_man.nes")) } } catch _ { print("Error copying files!") } if self.emulatorCore.loadROM((NSTemporaryDirectory() as NSString).stringByAppendingPathComponent("mega_man.nes")) { self.emulatorCore.configureEmulator() self.emulatorCore.screenDelegate = self.emulatorView self.emulatorCore.frameBufferAddress = self.emulatorView.frameBufferAddress self.emulatorView.delegate = self.emulatorCore } else { print("Error: invalid game path") } } }