Where are the headers for libbz2.dylib for the iPhone? - iphone

The headers for libbz2.dylib on the iPhone are missing, or contained in a less than obvious location. I've looked for bzlib.h, bz2lib.h, bz2.h, etc., grepped for patterns, and found nothing - are they included with the SDK, or do I need to just pull the header from the main libbz2 distro and use that instead?

Since the library is clearly available on the device, the header really should be in the SDK, but it appears that it isn't. I'd use the one that's packaged for the Simulator, since this is most likely to be the same as the one on the device:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/usr/include/bzlib.h
Then open a Radar case to ask that the distribution be fixed.

From the site below get the bzlib-0.5.0.0.tar.gz file and copy the files (.h and .c) inside the cbits directory to your Xcode project.
http://hackage.haskell.org/package/bzlib
So far it seems to work, I've managed to read the contents of a .bz2 file with the functions BZ2_bzReadOpen and then BZ2_bzRead.

Related

Creating an IPA, "contains multiple products"

I am working on an email client based on ReMail. Basically, I reused the ReMail project so that the MailCore etc dependencies would be all set up out of the box so I could build a new app on top of them. I'm trying to give the app to some beta testers via ad hoc, but when I try to create an IPA, I receive this error:
xxxx does not contain a single–bundle application or contains multiple products. Please select another archive, or adjust your scheme to create a single–bundle application.
I have set Skip Install to YES for all dependencies, and moved all files under Copy Header to the "project" section, but I am still unable to build a single APP file.
I don't know if this is significant, but when I open up the xcarchive file, within the products directory, I find a the APP file under Applications, and then a file structure mirroring the absolute path to the header files for MailCore.
Any ideas as to what might be going on? I'm very near the tearing-out-chunks-of-hair-in-frustration stage, and I don't think the unnaturally bald crazy person look would suit me.
Thanks!
Try removing the “Copy Headers” phase entirely. It's only supposed to be used for frameworks, not static libraries. The Xcode static library template that includes a “Copy Headers” phase is wrong.
Check out the “Working with Schemes and Projects in Xcode” video from WWDC 2012, starting at 45m10s.

Do I need to set something before I can write to an App's Documents-directory?

I have been struggling (see here & here) for a while now to get it right to write to my app's documents directory. It always tell me "Not a Directory" even though the code is just copied from a simple tutorial etc.
Do I need to set anything in the Target or project settings to be able to accomplish this?
My code works totally fine on the simulator, but not on the actual device.
Usually it works like a charm to write on the documents directory. No need to setup anything on the project level. The only difference I see regarding the file system is that it is case sensitive on the device and case insensitive on the simulator. Say you want to write in a folder called "Document", if you spell it "document" in your code it is going to work in the simulator (just like it would work if you spelled it "doCumEnt"), but it won't work on the device.
The answer is NO
The problem got solved by setting a non standard Bundle ID in die info.plist
I used the Bundle ID from iTunes Connect for this specific app. Now everything works perfectly.

iPhone MoveMe Example - trouble with DisplayStrings

I'm starting to play a bit with iPhone applications and I downloaded the MoveMe example from the apple web page.
I managed to run the app, however I do not get the strings displayed. I noticed that the DisplayStrings.strings file, although it exists in the app folder, does not appear as one of the resources.
I tried adding it as a resource, but then after compiling I get an error saying "copystrings failed with exit code 1". I cannot find anything online regarding what the origin of this problem is...
The file itself is in utf16 (big endian), and contains simply a list of strings separated by new lines.
Any ideas?
Thanks.
I was having the same problem and as a workaround I renamed DisplayStrings.strings to DisplayStrings.data and added it as a resource. I then modified init in PlacardView.m to use the new filename. This made Xcode happy.
I fixed this by adding the DisplayStrings.strings file as a resource. However, when you do this it defaults the type to 'text.plist.strings' which is incorrect, since the file is just text. So, right click on the DisplayStrings.strings file in resources and change the type to 'text'. This solved the problem for me.

Add files to the app on the run

I was wondering if I could add the files to the app resources from an external url. As in suppose I see a url which has a nice image. Can I download that from the website and add it as a resource and use it locally for later use ? I am sure there is way But Need some guidance on how to approach the problem and The set of Classes that could be used with explanantion.
Thanks,
You can't change anything in your app bundle after it has been signed. If you did, you'd make the signature invalid, and the iPhone would refuse to run your app. Your best bet is to add the files to the Documents or tmp folder. There really isn't much of a reason to have stuff in your own bundle - is there a reason you have to have those images there?

How do I make the iTunesArtwork image without an file extension?

Apple seems to say that this image should have no extension. But how is that possible to have a file without an extension? Does this make sense? Or did I get that wrong?
It does make sense. Files are allowed to have no extensions. In fact, the extensions are basically a legacy form of metadata that allows the OS to identify their type without having to look inside for header information. Go ahead and rename a .PNG or .JPG file to have no extension and you should have no problems.
It works fine without an extension. When iTunes loads it out of your bundle (for ad hoc distributed apps), it peeks inside the file to figure out if it's a png or jpg.
Note that when you submit an app to the app store at the iTunesConnect web site, you don't put this image in your app bundle, but upload it separately. It should be a jpg file and must have a .jpg extension or iTunesConnect rejects it.
It's possible for a file to have no extension - just save it from a program that lets you specify "all types". It 'makes sense' insofar as the data is still there, but no instruction set is included for how to interpret the data: If Apple has said don't provide an extension, then don't and it should be fine.