Данные песни сырых данных MPMediaItems

Я думаю, что все еще назвал бы несколько взаимодействующих классов модульным тестом при условии, что модульные тесты на class1 тестируют функции class1, и модульные тесты на class2 тестируют его функции, и также что они не поражают базу данных.

я называю тест интеграционным тестом, когда это пробегает большую часть моего стека и даже поражает базу данных.

мне действительно нравится этот вопрос, потому что обсуждение TDD иногда чувствует себя немного слишком пуристским мне, и для меня хорошо видеть некоторые конкретные примеры.

17
задан conradev 24 September 2011 в 17:49
поделиться

1 ответ

You can't, and there are no workaround. An MPMediaItem is not the actual piece of media, it is just the metadata about the media item communicated to the application via RPC from another process. The data for the item itself is not accessible in your address space.

I should note that even if you have the MPMediaItem its data probably is not loaded into the devices memory. The flash on the iPhone is slow and memory is scarce. While Apple may not want you to have access to the raw data backing an MPMediaItem, it is just as likely that they didn't bother dealing with it because they didn't want to invest the time necessary to deal with the APIs. If they did provide access to such a thing it almost certainly would not be as an NSData, but more likely as an NSURL they would give your application that would allow it to open the file and stream through the data.

In any event, if you want the functionality, you should file a bug report asking for.

Also, as a side note, don't mention your age in a bug report you send to Apple. I think it is very cool you are writing apps for the phone, when I was your age I loved experimenting with computers (back then I was working on things written in Lisp). The thing is you cannot legally agree to a contract in the United States, which is why the developer agreement specifically prohibits you from joining. From the first paragraph of the agreement:

You also certify that you are of the возраст совершеннолетия в юрисдикция, в которой вы проживаете (в моложе 18 лет во многих страны) и вы заявляете, что вы имеют законное право стать Зарегистрированный разработчик iPhone.

Если вы сообщите представителю WWDR, ​​что вы не достигли совершеннолетия, он может понять, что вы нарушаете соглашение, и будет обязан закрыть вашу учетную запись разработчика. Просто дружеское предупреждение.

-3
ответ дан 30 November 2019 в 11:04
поделиться
Другие вопросы по тегам:

Похожие вопросы: