ios - How to upload pdf file to parse database in Xcode? -
i'm trying upload pdf file 'supporting files' folder parse database. however, when set 'pdffile' in code nsexception saying error domain=nscocoaerrordomain code=4 "the folder “test.pdf” doesn’t exist.".
nsstring *filename = [[nsbundle mainbundle] pathforresource:@"test" oftype:@"pdf"]; nsdata *pdfdata = [nsdata datawithcontentsoffile:filename]; pffile *pdffile = [pffile filewithname:filename data:pdfdata]; [pdffile saveinbackground]; pfobject *testobject = [pfobject objectwithclassname:@"matchreports"]; testobject[@"file"] = pdffile; [testobject saveinbackground];
Comments
Post a Comment