I am using MPMediaItem, and getting all songs from library.
My issue is, if i want to get only particular file which I want.
Anybody can know ?
MpMediaItem provides property like
MPMediaItemPropertyAlbumTitle
MPMediaItemPropertyArtist
MPMediaItemPropertyGenre
MPMediaItemPropertyComposer
MPMediaItemPropertyTitle
By using above properties you can identify the file which you want.
Related
I am trying to edit a custom metadata value of a JPG file (static image of a Live Photo created by iPhone). Tried the exiftool but it doesnt work for me.
For reference this is the metadata of one of the file - https://www.metadata2go.com/result/93287b28-1c16-4491-affe-8ffbd6d9dd1a
the field I would like to edit and update is
Content Identifier DF64C2AE-ED3C-4778-BFCA-C15277E521D2
I tried updating the field with exiftool
exiftool -ContentIdentifier=5A0FFB8D-5410-4464-A343-61AE4A6C1109
LW16.jpg
It always throw error like file cannot be read or Warning: Tag 'ContentIdentifier' is not defined
Nothing to do.
Anyone can help me with this or guide me with another method to change the value ?
I am working on an app where I want to copy some text and image and allow user to paste it anywhere. I know it is done using UIPasteboard and I have implemented copying of image but now I want to copy image and text both and then let user paste it. There can be several images and text messages which can come in any order. It is like a paragraph being written with text and images. Is this possible? Can someone suggest me how can I achieve it?
Regards
Pankaj
You can put anything you wish in the pasteboard, including multiple entries like of type UIPasteboardTypeListString and another of type UIPasteboardTypeListImage, and even another of type #"My Made-Up Type". Think of it as a shared mutable dictionary.
It's up to the receiving application to understand what to do with them.
I want to dynamically change display name from within the application. Is there a way it? i dont want to use .plist. i want to use with xcode from application. Thanks
${PRODUCT_NAME} How can i call this value with code ?
The app name is defined in the app's info.plist file..
That come in Main Bundle..and iOS does not allow anything to be written and updated in Main Bundle..
So you cant programmatically change contents of app info.plist having app's name...bundle identifier ..etc
No, it's not possible. The Info.plist and everything in the app bundle is read-only once it's installed on an iPhone.
Add the following code to get the product name
NSDictionary *infoPList = [[NSBundle mainBundle] infoDictionary];
NSString *appName = [infoPList objectForKey:#"CFBundleDisplayName"];
appName is the value of "Bundle display name" or Product Name
I don't believe so.
You can localise it -- i.e., display different names depending on the language in use -- but I don't think you can change the name dynamically. That's probably a good thing... it could get pretty confusing if abused.
I'm new here but I'd like to learn very well iPhone SDK...
I'm making an iPhone app where I'd like to show a modalView controller at launch of my app... How can I do this?
In this modalView, I request some informations and the view must appear only when these informations aren't saved!
Anyone can help me?
P.S.: Sorry for my bad English but I'm Italian... :D Thanks!
First, try to avoid to use NSUserDefautls as it's not application specific and can cause troubles under some circumstances (see reference docs).
I'd suggest to save your app specific data to some plist file for which you can check for at app startup -(void) applicationDidFinishLoading: method of your app delegate class - and decide if your modal view should be shown or not.
Let's say you have application wide accessible
NSMutableDictionary instance where you store your
preferences. When app is about to quit i.e. - (void)
applicationWillTerminate: method of your app delegate, simply store content of that dictionary to plist somewhere under you app directory structure (Documents folder is a good choice). See NSDictionary reference on how to store/read plist files. It's pretty simple.
Typically, you check for your saved data and if it's not there, you assume that it is the first run.
Thus, you first need to decide how you are going to persist data:
User defaults (NSUserDefaults).
Store a file. Typically a property list (plist) in the Documents directory.
Core Data.
I'd like to use NSUserDefaults...
i want to modify entries in custom plist file programmatically.
can anybosy suggest me a way to do that? i have tried modifying values of keys but file is not getting saved..
You don't provide much information as to what you've tried, but I assume from the tag that this is on the iPhone. In addition to Pat's suggestion, make sure that the plist you are trying to edit is not within your app bundle, but located within an editable location like Documents or Library within your sandbox.
I would look at the NSDictionary method:
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag
I'm sure there's a similar method for NSArray.