how to Uncompress/Extract *.nib files from a compiled iOS app - iphone

Is there any way to get uncompressed *.nib files from a *.ipa file which is downloaded from iTunes? I know there are ways to extract the resources (jpg/png/sounds) using File juicer or similar tools. But I'm looking for a tool which can extract the *.nib or *.xib files from an *.ipa file to reuse the nib.
Thanks for any help.

I believe in an older version of Xcode, maybe 3.0 or even before, Interface Builder could read .nib files. These are basically compiled, like source code, and there is no way to decompress them or to see the contents, much like .png images are crushed.
Update
Found a video on Youtube, http://www.youtube.com/watch?v=dInaIlzVsn8, but have not tried it. Claims to be able to open compiled .nib files.
Update 2
Here is another possible way to open a compiled .nib. This process requires you to retrieve a .nib from Hulu Desktop application, which is not compiled, and replace it's contents.
http://www.macstories.net/tutorials/how-to-edit-nib-files-in-snow-leopard/

A bit of a late reply, but could save others the hassle of finding a better solution.
To extract the nib files from the .ipa file:
Rename the MyApp.ipa to MyApp.zip
Extract it
Inside the extracted folder right click the MyApp.app and press "Show package contents"
Here you will have all the resources, including the nib files.
To open the nib files in interface builder convert them into xib files using NibUnlocker from http://www.charlessoft.com

Related

How to compile Object(*.o) files added with iPhone app?

I have created a simple native iPhone app. This project contains with c,c++ source files for doing some operations. Its radio tuning app, thats work fine. I want to give a source code to some one, and want hide all of source code c,cpp file (Because strangers don't want to see my code). So what i did is , i have compiled iPhone app and collect all (.o) files from build path and added to my resource folder.
For example if my application have these two files
radio.c
radio.h
when i build radio.o present on build path directory. my build path is (/Users/Macuser/Projects/Radio//build/Radio.build/Release-iphoneos/HDRadio.build/Objects-normal/armv7/radio.o).
So i copied radio.o file and added to my source code directory, and i removed the radio.c and radio.h file. When i compile it gives a error, radio.h file not found.
What could be the problem here? please let me know. Thanks in advance..
Note:
When i add radio.h file to my project it compiles successfully. I don't want to see my radio.h and radio.m file. is this possible?
There must be some other file in your project that is importing or including radio.h. Your .o file is used for linking but import/include dependencies are resolved when compiling the source. (A .o file is not source.)
If you don't want to provide .h files, the way around that is to create a static library to contain all the .o files that depend on each other. (However, to call any functions inside your library, the person still needs a .h with the declaration of public functions.)

text files used in my project compatible with iPhone/ipad?

I have made an app where I am loading my table with data from a text file. I know, I could have used plists, but I am more comfortable with test files, as you don't have to worry about key names and all. I just wanted to be sure though, if the text files stored in my project will work fine once i load the app onto iPhone/ipad?? It works fine now when i run it on the mac, in the simulator. thanks
Yes, your files will work fine. Iphone support .txt, .html, .xml, .json and other simplest text formats.

Localizing iphone app html files and strange xcode 4.2 warnings

I've got an App that I am trying to localize for several languages. I'm doing most of the localization through .strings files, but for the larger help files, I need localized versions of html files.
I've read Apple's documentation as well as doing many searches on Google, and I think I am doing things correctly.
In my xcode project directory, I have an "en.lproj" and a "ja.lproj" (Japanese). I put versions of my HTML help file in each directory, and I import these into my Resources group in xcode. After doing so, the files seem to show up correctly. I see a "help.html" file under Resources, and it is a "group" and if I look inside it I see:
help.html (english)
help.html (japanese)
When I build my App, my App seems to correctly contain the two versions of the files under their appropriate .lproj directories, and everything is working correctly when I run the App (I see English documentation when settings are English, and Japanese when settings are Japanese).
However, when I build my project, I get annoying warnings from xcode 4.2:
Warning: Multiple build commands for output file .../ja.lproj/StartQuizController.html
Warning: Multiple build commands for output file .../en.lproj/StartQuizController.html
From what I understand, these "multiple build command" messages occur when there are conflicting filenames that are being added to your App. However, since these files are localized and exist in their own subdirectories, there is no real conflict.
Am I doing something wrong, or are the warnings a bug in xcode 4.2?
Thanks,
Ron
I think you can prevent these warnings if you do it the Xcode way.
Xcode uses only one copy command to copy the localized files, you have probably two separate commands.
You could try to delete the files form the "copy bundle resources" build phase first.
Delete the copy command for the localized files and add a new one. If Xcode treats your localized files right it should show a single file instead of a file for each localization in the "Choose items to add"-Picker.
If that doesn't work just remove them completely and add the physical files again.
Backup all your html files. Then delete them from the project (both logical and physical).
Add the English version of the file to Xcode, let Xcode copy it to your directory.
Select file in left sidebar
Open first tab of the right sidebar
add localizations by using the + button in the localization section
either replace the content of the file trough Xcode or use Finder to replace the localized versions.
I´m trying to localize my project as well. I always add a in-App user´s manual in a html file wich gets loaded on a UIWebView.
I haven´t done it yet, but what I´m going to do is to create different files for each language, say for example:
info_en.html // for english
info_es.html // for spanish
info_ca.html // for catalan
then when the webView gets loaded, instead of loading the #"info_en.html" file, I will load the NSLocalizedString(#"info", nil); Then, in each localized string file, the name for the html file will match the language.
I believe this should help but, again, I haven´t tried myself yet.

iPhone project - collect files into one place

Sorry if this has been answered before but all my searches do not return anything related to this.
Is there a way to collect all the files referenced in a project and save them in the procject folder automatically? Rather that having links to places where you may accidentally delete the files.
Thanks,
Eds
Xcode doesn't have a particular feature to support this, but when you add items to your Xcode project it does give you the option to copy those items to the project directory. Otherwise you need to manually copy the items to a common location.
What do you mean collect all the files? Do you mean your external files or class files. Your external files like images or audio/video files should be added into Resources directory, it does not matter where is the root directory of these files. Then, you can access with their name in the project.

iPhone SDK - Adding zipped content in resources and then unzipping into Documents folder

I have some resources (zipped) that needs to be shipped with my iphone application. When the app launches for the first time, this zipped file needs to be moved/copied to the Documents folder and unzip it there. User can then add more files to this path from the application. Can someone please suggest how can I achieve this?
Thanks!
Based on your comment above:
The reason I want to add a compressed
resource because there are multiple
files. If I don't compress then I'll
need to move files individually. I'll
also need to maintain a list of files
somewhere so that I can read the file
name and then move them. I thought
zipping and unzipping was a simpler
solution.
You could add all the files to a folder in your bundle. When the app launches for the first time use fast enumeration to run through the folder and what ever it finds in that folder, it copies into the Documents folder. Handling folders within folders is slightly more complex (add recursion maybe). This way you don't have to worry about zip or tar, nor to keep a directory of files to install.
Just place the folder of files you want into Xcode's resources folder and tell it to import as a folder not as a group. That way the files get installed in your resources inside a folder instead of just as individual files all over the place.
EDIT:
Better yet, do what I say about putting all the files you want in one folder, add to your project, but not as a "Group", and then at first launch use:
[[NSFileManager defaultManager] copyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error];
and it will copy your whole directory from one place to another. EASY!
Add the libz.dylib Framework to your project, and include Deusty's NSData gzip category which will give you compression/decompression methods.
While this is available by using the libz.dylib, it really is unnecessary as it save you little (if any) space. You application bundle is already compressed when being transferred to the phone. Compression on top of compression usually yields little additional compression.
Try it out yourself. You may find that shipping your app with unzipped contents may take up just as much space as zipped contents.