ios - How to embed images and sounds in an iPhone app? -
i having real hard time understanding how embed many images , sounds in iphone app. when embed, mean want images , sounds downloaded app, , of images appear when app run. other images saved in app's disk space, when user presses button, image or sound accessed , displayed or played.
i have read tutorials on using 'core data' , such, seems way create objects can used reference such data items, or storing small files binary data. can please tell me how in xcode can specify directory of images , .mp3s loaded onto phone app, , how can call media code?
some example code following solve problem:
an app loaded onto phone, , contains 3 buttons. if user presses button #1, sound heard. button #2 plays different sound, , button #3 changes uiimageview different picture. (this isn't homework assignment or something, if code example, need in app , understand process)
thanks!
i mean want images , sounds downloaded app
simply add images , sounds project. make sure specify (in add files project dialog) copied project , part of target. result images , sounds built app (in called bundle, in particular main bundle - see nsbundle docs). can fetch them out, needed, in code. example, fetch image, use imagenamed:
. refer sound, refer file resource within main bundle.
other images saved in app's disk space
that different matter. have images somewhere while app runs. there no way have user download app , image end in app's disk space: app must populate disk space, in real time, app runs. @ time user downloads app, associated disk space, outside app bundle itself, empty.
Comments
Post a Comment