Async execution of shell command not working properly

后端 未结 2 1257
忘掉有多难
忘掉有多难 2021-01-21 13:31

So, this is my code :

- (void)runCmd:(NSString *)cmd withArgs:(NSArray *)args
{
    NSLog(@\"\\nRunning ::\\n\\tCmd : %@\\n\\tArgs : %@\",cmd, args);
    [theSpi         


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-01-21 13:53

    You use readInBackgroundAndNotify to schedule your reading. This method reads only one buffer full of data and notifies. You either need to call readInBackgroundAndNotify in your notification method again to read more data or you need to use readToEndOfFileInBackgroundAndNotify if you want to receive all the data at once.

提交回复
热议问题