开发者

How do I write ALAsset in a NSData

I'm trying to write ALAsset in a NSData and somehow came up with the following code which does not work. What I would like to know is, whether the code is similar to this? Or is there another way of doing it?

NSData *data = [[NSData alloc] initWithContentsOfFile:@"assets-library://asset/asset.MOV?   id=10开发者_Python百科0000009&ext=MOV" ];


The defaultRepresentation of an ALAsset has a getBytes:fromOffset:length:error: method. Use that.


There's a space between your "?" and "id=.." is this the problem?

The best way to debug this is to first try opening that file you name (or creating an NSURL and using initWithContentsOfURL as suggested by Max) and then running the debugger, checking whether that succeeds. Right now you're debugging a few things simultaneously, break out that compound statement and figure out what could be going wrong

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜