I tried to parse AlbumData.xml and found strange GUID string value, how to convert it to integer value ?
eg : f7hWRm%xSMiYVfEynRpo7g = 4.29497e+09
Thanks in advance
You simply don't. It's an NSString.
A suggestion is to change the extension to .plist and open in Xcode. You can then see the data types.
Sort of a related thing, iTunes sends a NSDistributedNotificationCenter note whenever its library changes. Does iPhoto do something similar for its AlbumData.xml? I didn't know if I should post this as a new question since it is somewhat relevant to this one.
Related
I’d like to know if there’s any possible way i can get the file title or comments as a string in VB.NET. It’s easy to get the file name but the title under details in the actual files properties seems much harder to get. I need to get the entire property title of a MP4 file i give it. Thanks. I do not have much knowledge of VB but I’m hoping someone can help me :)
Use this:
Dim information = My.Computer.FileSystem.GetFileInfo("C:\myfile.mp4")
https://learn.microsoft.com/en-us/dotnet/api/system.io.fileinfo?view=netframework-4.8
To get more information, this could be a possible answer:
Get extended file information details
I'm looking into what it takes to develop a PrintService on android. After reading some on-line docs I'm not quite clear on the format of data returned by PrintDocument.getData() method. I'd expect that in the case of PrintDocumentInfo.CONTENT_TYPE_PHOTO the returned data will be an image (I'm not quite sure about this). However, what can I expect when content type is CONTENT_TYPE_DOCUMENT?
There is a sample of PrintDocumentInfo that uses a builder to build a pdf file. Is this always the case? That is, is content of CONTENT_TYPE_DOCUMENT always in pdf format?
I'd appreciate any suggestions and/or pointers to relevant on-line docs.
Thanks.
It is always PDF for CONTENT_TYPE_DOCUMENT.
I want to write an extension for VLC in Lua. I have never worked in Lua, and I can't find any information about this problem.
There is a function to get the current subtitle line directly (which is on the screen) ?
Another problem:
What time of unit will be stored in this variable?
local elapsed_time = vlc.var.get(input, "time")
I couldn't find anything except a two year old post which might be relevant: https://forum.videolan.org/viewtopic.php?f=29&t=102482.
About the get function, according to http://www.videolan.org/developers/vlc/share/lua/README.txt it gets the time property of the input object. You would think it were same as input.time but maybe not.
OK, I admit NSUserDefaults, being a Mac-specific thing (and me being a Mac programmer for the last couple of years), is one of the things I haven't delved into that much... so here are some issues/questions I've come across :
I understand that NSUserDefaults is basically an NSMutableDictionary written as a .plist.
My questions :
Given that I'm running OS X 10.7 (Lion) and having enabled Sandbox, where is my app's .plist file? (I've search in both ~/Library/Preferences/com.example.myapp.plist and ~/Library/Containers/com.example.myapp/Data/Library/Preferences/com.example.myapp.plist but none of these seems valid
I understand that this .plist file is created the first time the app launches, correct?
registerDefaults: is to be used at application launch (e.g. in awakeFromNib) and provide a Dictionary of default values that are immediately stored in the .plist file, and changed only if a different value is set at some point, correct?
When we're setting a specific Key-Value pair, is that pair automatically and immediately saved to the .plist file? And if so, why/when should we use synchronize? (Is using it every single time some value is set an overkill, or should it be reserved for special cases?)
Sidenote : I hope nobody complains about my use of the osx tag. However, I'm really tired of seeing Cocoa Touch / iOS related answers to my (mostly) OSX-related questions. So, here you are... :-)
EDIT : For some really helpful insight on the subject, please have a look at the accepted answer as well as the comments below it.
Answer 1. The home directory is hidden in Lion, so you are not able to enter the path(Without seeing the folder you can not enter inside the folder from Finder). You can use Path Finder to move around your hidden directories.
Answer 2. Not always. There can be multiple plists in a single application. Few gets created at first launch, few at some specific action. Actually it depends when the plist file are created and how to use it.
Answer 3. registerDefaults: registers default values are when the user has not set other values to that property. It will not override whatever the user has stored when the app is opened later. You can use it in anywhere, but as stated it will be used once.
Answer 4. For Mac OSX application there is no performance and overkill issues, however for iOS it has. It is always better to use [[NSUserDefaults standardUserDefaults] synchronize];
What is the best way to read string input from a simple Objective-C console application?
I would just like to store the input as an NSString variable.
I've seen multiple people post about scanf, gets and others, but they everyone seems to say that they're "unreliable", or "open to attack".
I can see how this could be true for gets but I'm looking for the best possible way to do this.
Thanks!
scanf should be mostly secure as long as you use your input correctly.
I've heard of scanf_s which is supposed to be more secure but work the same way.