iPhone Or Mac Header File? - iphone

Just a small question...
How is it that you tell the difference between an iPhone header file which you can use in conjunction with iPhone development, or a mac specific header file.
Many thanks,
Stu

Many are the same, but not all are included in both. It all depends on which SDK you are building against as to which you have available to you. Please see the iPhone Reference Guide and the Mac OS X Reference Guide.

One quick way is to try and pull up something the header references in the XCode documentation, if you check the document sets the docs are looking at and un-check "MacOS" leaving the iPhone stuff, it will not find anything the iPhone cannot use.

Related

Fake carrier string in 4.3.2 iPhone simulator

I'm trying to change the fake carrier name in the iPhone simulator as illustrated in the link:
http://www.cocoadevnation.com/2009/11/15/change-iphone-simulator-carrier-string/
The problem is I can do it on the 4.0 iOS simulator but on successive iOS versions (say at least 4.3) apparently this trick is not working any more.
Any of you know how to make it work?
Actually the problem does have a solution -- it's just changed. The information for the carrier is now read from the Springboard.strings file, located at
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator60.sdk/System/Library/CoreServices/SpringBoard.app/English.lproj/SpringBoard.strings
Note the simulator version part of this path will differ according to the version of XCode you are using -- I'm using 4.5. Note also that the default configuration for this file is binary but you can convert to XCode-editable-form with
plutil -convert xml1 Springboard.strings
Once you've done that, edit and change the value for the key SIMULATOR_CARRIER_STRING to what you want to use. You can use this same technique for non-EN languages--just edit the appropriate .../<lang.lproj>/Springboard.strings file.
I wrote a Python script based on krausefx's answer from another thread on the same topic.
It allows you to change the carrier name for certain or all languages with just a short call from the command line. You can also restore all of them to the default. I hope you enjoy it.
PS: It's iOS 7 only but could easily be changed to work with iOS 6.
For anyone interested, I found out that starting from the iOS 4.2 version, the iPhone simulator does not honor SBFakeCarrier nor SBFakeTime and SBFakeTime preferences.
So the problem has no solution.

iPhone: How to use Tesseract

This is regarding use of Tesseract in an iPhone app. I followed the steps provided here:
http://iphone.olipion.com/cross-compilation/tesseract-ocr
Now I have 2 questions:
1) How to use this in my iPhone project (which files need to be included, methods need to be called, etc.)
2) I googled and found that I'll have to include libtesseract_api.a
but got this message:
file was built for unsupported file format which is not the architecture being linked (i386)
Please help me to understand this.
I guess you have tried to run the app in Simulator, which will support i386 architecture.
Please follow this link to make the static library.
Start here:
http://tinsuke.wordpress.com/2011/02/17/how-to-cross-compiling-libraries-for-ios-armv6armv7i386/
and then follow this updated guide:
http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/
It will help you cross compile and build a universal library that contains the arm6/arm7/i386 all in the one statically linked library so it should work on simulator and device and be suitable for AppStore distribution.
Also if you have XCode 4.3 or higher beware and read the comments about how the developer directory has changed.

Is a Dynamically Linked Framework possible on iOS?

The keyword here is possible. I know of a few resources that talk about this and how to create static frameworks - here: https://github.com/kstenerud/iOS-Universal-Framework and here: http://db-in.com/blog/2011/07/universal-framework-iphone-ios-2-0/
I'm interested to see if it's possible to create a dynamically linked framework in an app that will not be submitted to the app store. I know it's impossible to write to the application bundle on a device without jailbreaking it. Is it possible to say, download a compiled framework file, put it in the documents directory and then access it via the application (think plug-in architecture). I know that if it is, you would be turned away from the app store for submitting it, but let's say this was an enterprise app, or an ad-hoc distributed app where Apple would not have to approve.
In my initial research I haven't found anything supporting that it is possible, but I feel like this may be such a fringe case that no one has published anything about it. Looking for a guru to give me a definite "no" before I give up.
not sure if this is what you are after but according to Apple there dynamically linked libraries even usable in iOS - for example the system libraries... XCode contains copies of them and references them via symbolic links...
see near the end of this http://developer.apple.com/library/ios/#documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/iPhoneOSFrameworks/iPhoneOSFrameworks.html#//apple_ref/doc/uid/TP40007898-CH6-SW3
just an idea:
put the .dylib + include files you want to use into the respective folders where XCode expects the system libraries... use themn and then put symlinks into your bundle on deployment... let the symlinks point where ou copy the .dylib
I believe the answer is no. Apps on the iPhone are sandboxed. That is, aside from Apple supplied frameworks, an app cannot access anything outside of its own build.
This is possible now with IOS 8 Xcode 6.

iPhone: is YAJL accepted for usage by the AppStore?

Does anyone know if using YAJL for JSON parsing on iOS is accepted by the AppStore?
Apple doesn't block apps for using specific libraries unless they break the TOS. I have used YAJL in iPhone apps before without any problems.
I don't see any reason why it wouldn't be. You need to link as a .a not .dylib or include the source in your app.
You might want to look at TouchJSON as well http://github.com/schwa/TouchJSON

Xcode conditionals list, where do I find them?

I am trying to learn about all possible conditionals that can be used on Xcode regarding the iPhone and iPad.
I have found the file "TargetConditionals.h" on
Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/include/
but this file do not shows all possible conditionals, just a small set.
I don't see, for example, __IPHONE_3_1
and others.
As Apple docs as vague as hell, I as you guys where can I find a complete list with ALL conditionals?
thanks
Check out Availability.h. I don't know if there's a list that compiles everything across all files, but this one has the iPhone/Mac OS X version conditionals.