ios - NSData is returning nil for same file at different filepaths -
i stored audio file of format .aiff in 2 different folders. nsdata returning nil 1 file path though both file paths have audio file. double checked file paths.
the path this:
//url1 file:///users/venkatamaniteja/library/developer/coresimulator/devices/80b8117e-d2c9-4b42-8a76-9a89a10fb1c1/data/containers/data/application/fd17ad64-eaf9-4578-b50d-0b5bf6f2deff/documents/28apr15_090827am.aif //url2 file:///users/venkatamaniteja/library/developer/coresimulator/devices/80b8117e-d2c9-4b42-8a76-9a89a10fb1c1/data/containers/data/application/b60cf270-73ca-4be4-ba75-b2ac3642360d/documents/28apr15_090827am.aif nserror *err; data = [nsdata datawithcontentsofurl:url1]; //this working fine audioplayer = [[avaudioplayer alloc] initwithdata:data error:&err]; data = [nsdata datawithcontentsofurl:url2]; //nsdata returning nil can tell me why url2 getting nil nsdata?
you trying read file outside of running app's sandbox. while both may exist, presumably running application id "fd17ad64-eaf9-4578-b50d-0b5bf6f2deff", why url working while other 1 isn't.
i recommend watching wwdc video a practical guide app sandbox more on how security model works.
Comments
Post a Comment