Monday 15 September 2014

ios - Recorded Audio file doesn't Move? -



ios - Recorded Audio file doesn't Move? -

i have recorded voice file store in temp directory .m4a format want move directory in document directory.

but can not move got error. "the operation couldn’t completed. (cocoa error 4.)" userinfo=0x7b660190 {nssourcefilepatherrorkey=file:///users/vinodjadhav/library/developer/coresimulator/devices/067a2eac-9987-4861-8746-97117dce72f2/data/containers/data/application/5744f8bc-4256-4010-8a14-60b228859f88/tmp/14-11-201410:32:45.m4a, nsuserstringvariant=( move ), nsfilepath=file:///users/vinodjadhav/library/developer/coresimulator/devices/067a2eac-9987-4861-8746-97117dce72f2/data/containers/data/application/5744f8bc-4256-4010-8a14-60b228859f88/tmp/14-11-201410:32:45.m4a, nsdestinationfilepath=/users/vinodjadhav/library/developer/coresimulator/devices/067a2eac-9987-4861-8746-97117dce72f2/data/containers/data/application/5744f8bc-4256-4010-8a14-60b228859f88/documents/xpensetag/xpenses/sagar/823564440/audio/audio.m4a, nsunderlyingerror=0x7b660250 "the operation couldn’t completed. no such file or directory"}

this dest url

dest url = /users/vinodjadhav/library/developer/coresimulator/devices/067a2eac-9987-4861-8746-97117dce72f2/data/containers/data/application/5744f8bc-4256-4010-8a14-60b228859f88/documents/xpensetag/xpenses/sagar/823564440/audio/audio.m4a

this source file url

source url = file:///users/vinodjadhav/library/developer/coresimulator/devices/067a2eac-9987-4861-8746-97117dce72f2/data/containers/data/application/5744f8bc-4256-4010-8a14-60b228859f88/tmp/14-11-201410:32:45.m4a

-(void)moveaudiofilefromesource:(nsstring *)sourceurl todest:(nsstring *)desturl { nslog(@"source url = %@", sourceurl); nserror *error; if (![[nsfilemanager defaultmanager] moveitematpath:sourceurl topath:desturl error:&error]) { nslog(@"could not remove old files. error:%@",error); } }

where wrong?

you can re-create file source path destination path . seek this

-(void)moveaudiofilefromesource:(nsstring *)sourceurl todest:(nsstring *)desturl { nslog(@"source url = %@", sourceurl); nserror *error; if (![[nsfilemanager defaultmanager] copyitematpath:sourceurl topath:desturl error:&error]) { nslog(@"could not remove old files. error:%@",error); } }

ios

No comments:

Post a Comment