Saving / Exporting File in objective-c which I can then open in Ruby - objective-c

I am an absolute beginner, so I am sorry if this question has been asked before and I simply couldnt find it because I was lacking the right search terms. Feel free to point me to the right posts and delete this one her. So apologies in advance.
I am looking to program a software that imports a list and links every word or sentence on that list to an audio file. I then want to export the whole thing: the list, the audio files AND how the relations between the words in order to use everything with a different app, programmed in a different programming (that is all yet to come. it will probably be in ruby)
Since I will probably not be able to open coredata files with ruby, which file format will be the best for me, so that I can use it in ruby etc.? or will I have to save all audio files individually, as audio files and have a separate txt file that links the words to the files? This sounds... wrong? :(
Sorry I am so lost right now!

You can use json file to hold all your data. It is widely accepted as a data interchange format. But better not to embed audio files in another file. Instead you can save path to you audio file.

Related

Extract text from .pdf file in theory

I know there are thousands of ways to extract text from .pdf file - there are online converters, libraries, packages and it is possible to do it in any programming language. For the needs of my thesis I am looking for the source that explains how it works - I found some presentation that text is basically anything that is between parenthesis but when I opend the .pdf file with some notepad I don't find it (actually there are no real words).
Is there any work, article that describes how .pdf file works? What language is used? What are the layers of it? Can we create a .pdf file in some notepad from scratch - then just save it as .pdf and see it properly? How such pdf_to_text tools (ex. in R or even JavaScript) work from the inside?
I will be so so grateful for any answers, help, links, explanations!

embed identification in file and resistance to detection

Say I'm distributing a file that I want to be secret, and I assign each person that I give the file a unique id.
How can I embed this id in the file so that I can determine who leaks my file?
Some file formats have a section in which I can put information that won't render the file corrupt. But this is easily detectable by looking at the specific section, or by changing the information.
I would guess that any solution is identifiable by byte comparison, but I was wondering if there exists solutions that embed the id in a part that if changed, renders the file corrupt. (I would guess this would be file format specific, but this question is to learn about techniques, so I'd gladly read about specific cases.)
Thanks!
For image files and Unicode text you may use Steganography.
For audio files there are special watermarking algorithms that add noise not heard by humans.
You may use metadata to add watermarks, but they can be easily removed by end user.
See at what is currently possible in this SO question: Good library for Digital watermarking

How to internationalize an iPhone App

I am trying to internationalize an iPhone app that was written few years ago and at that time unfortunately internalization was not the priority. As there are lot of nib files I have used ibtool to programmatically generate the nib files for each country. After running the ibtool utility i had to open up the project.pbxproj file and had to insert manual entries for the spanish language. Since i have to update lot of entries i did not choose this route.
I wanted to know how can i generate region specific nib file and have the entries reflected in the project.pbxproj file.
Secondly, I was unable to use gestrings option as the code doesn't use the NSLocalized method every where the text the is hard coded. while i prefer this option is there a safe mechanism to find out all the strings in the code base that can be internationalized?
Apologies for the long question. Any recommendations on how should i go about internationalizing the app?
Regards,
I solved this problem recently and came across the following links iphone-applications-localization-guide and ibtool-localization and Merging-changes-into-a-localized-nib-file
maybe it will help you.

How to parse and load text file with Core Data?

I resort to your expertly advice because I am sort of "new" to Objective-C, I have read a couple of books and docs (namely Aaron Hillegass & Stephen G. Kochan's books), but some things are still unclear to me, for lack of practise.
To put you in context, I have a NSDocument project that uses Core Data for storage.
I struggle with 2 things right now: reading/writing to files, and table views ^^
So my first question is about Core Data : is it only able to save in SQL, XML or Binary format ?
Or can I use core data to read/write in any format, according to what I declared in the plist file ?
I am trying to work with .po files, and I want to display the translations in a table view containing 2 columns (1 for the msgid and the other for the msgstr).
To read and write files in the po format and display lines in my table view, I most likely need to parse the files using line endings and characters such as "#"as delimiters.
I haven't gotten around to doing that yet (I have no idea how to do that yet!), but I would like to know if it is possible or if I need to restart my project that doesn't use Core Data...
Please DO NOT just throw links to the apple documentation at me, it's the most confusing thing ever, and feels like it's made for experts only! I need me some human-readable explanations :)
Thanks a bunch for any help and advice you can give me!
It is possible to write a different storage format for Core Data, but it is not easy and it sounds like you are not at a level where that is a possibility (no shame there, I'm not either).
If you are only displaying data from the .po files then there is no need to use CoreData. CoreData is meant to provide a file storage solution. You create/edit data and save it using coredata. If you have no intention to create and edit data then get rid of coredata, it will only get in the way.

Use ZIP-archives to store NSDocument data

I noticed that Apple started using zip archives to replace document packages (folders appearing as a single file in Finder) in the iWork applications. I'm considering doing the same as I keep getting support emails related to my document packages getting corrupted when copying them to a windows fileserver.
My questions is what would be the best way to do this in a NSDocument-based application?
I guess the easiest way would be to create a directory file wrapper, create an archive of it and return it in NSDocument's
- (NSFileWrapper *)fileWrapperOfType:(NSString *)typeName error:(NSError **)outError
But I fail to understand how to create a zip archive of the NSFileWrapper.
If you just want to make a zip file your format (ie, "mydoc.myextension" is actually a zip file), there's no convenient, built-in Cocoa mechanism for creating zip archives with code. Take a look at this Google Code project: ziparchive I don't believe a file wrapper will help in that case, though.
Since you cited iWork, I don't own iWork 09, but previous versions use a package format (ie, NSFileWrapper would be ideal) but zip the XML that describes the document's structure, while keeping attachments (like embedded media, images, etc.) in a resource folder, all within the package. I assume they do this because XML can be quite large for large, complicated documents, but compresses very well because it's text. This results in an overall smaller document.
If indeed Apple has moved to making the entire document one big zip archive (which I would find odd), they'd either be extracting necessary resources to a temp folder somewhere or loading the whole thing into memory (a step backward from their package-based approach, IMO). These are considerations you'll need to take into account as well.
You’ll want to take the data from the file wrapper and feed it into something like ziparchive.
Pierre-Olivier Latour has written an extension to NSData that deals with zip compression. You can get it here: http://code.google.com/p/polkit/
I know this is a little late to the party but I thought I'd offer up another link that could help anyone that comes across this post.
Looks like the ZipBrowser sample from Apple would be a good start http://developer.apple.com/library/mac/#samplecode/ZipBrowser/Introduction/Intro.html
HTH