I have started using the QuickBlox API in my code. I have used this code for the image upload and it works charm. I want to perform the same for a wav file and my code is,

NSData *wavData = [[NSFileManager defaultManager] contentsAtPath:@"1.wav"];
[QBContent TUploadFile:wavData fileName:@"wavFile" contentType:@"audio/x-wav" isPublic:YES delegate:self];

I have 1.wav file in my bundle and I want to upload this file to my server. The problem that I face is there is a crash occurring with the below message.

Content[1179:441f] *** Terminating app due to uncaught exception 'BaseServiceException', reason: 'file should be set'
*** First throw call stack:
(
    0   CoreFoundation                      0x037715e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x02bdf8b6 objc_exception_throw + 44
    2   Content                             0x000ada09 -[QBCBlobUploadQuery setFiles:] + 505
    3   Content                             0x000917b1 -[QBQuery setupRequest:] + 257
    4   Content                             0x00091504 -[QBQuery performInBgAsyncWithDelegate:] + 340
    5   Foundation                          0x028377d7 -[NSThread main] + 76
    6   Foundation                          0x02837736 __NSThread__main__ + 1275
    7   libsystem_c.dylib                   0x034825b7 _pthread_start + 344
    8   libsystem_c.dylib                   0x0346cdce thread_start + 34
)

I would like to know if I have to add any thing in additional.

Thanks.

有帮助吗?

解决方案

It seems like your wavData = NULL. Please check this.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top