Getting dyld: Symbol not found: _OBJC_CLASS_$_NSJSONSerialization on IOS4 - iphone

I get the following error when testing on iOS4:
dyld: Symbol not found: _OBJC_CLASS_$_NSJSONSerialization
While on iOS5 it's working fine.
Any help will be appreciated.

From the AFNetworking README :
"AFNetworking uses NSJSONSerialization if it is available. If your app targets a platform where this class is not available you can include one of the following JSON libraries to your project for AFNetworking to automatically detect and use."
With that being said, to prevent the following error make sure of two things
that JSONKit / SBJson / YAJL are included
That your "Deployment Target" is lower than iOS5 , that way AFNetworking would realize it can't use NSJSONSerialization and will fall back to one of the included JSON parsing classes.
Shai.

#hoshi is right. You can't use NSJSONSerialization on devices running older than iOS 5.0.
Here's the documentation from Apple's site. For my own code I also use the SBJson library.

Seems to be that the AFNetworking class is the one that use NSJSONSerialization.

Related

Smashtag (Stanford CS193p Twitter client) not loading on iPhone

I'm trying to get my SmashTag app to load on my phone. All the certificates and things are in order (i.e., I've been able to load other apps from Xcode onto the phone) but when I try to load Smashtag I get errors related to the Twitter framework.
I load the app, my iPhone appears to launch the app, and then Xcode gives me this message in the console:
dyld: Symbol not found: __TWvdvC7Twitter4User10screenNameSS
Referenced from: /var/containers/Bundle/Application/AB50558C-00A2-4C61-B81D-F862C8B25EDA/Smashtag.app/Smashtag
Expected in: /System/Library/Frameworks/Twitter.framework/Twitter
in /var/containers/Bundle/Application/AB50558C-00A2-4C61-B81D-F862C8B25EDA/Smashtag.app/Smashtag
I've done a bit of SO research and it looks like this is some kind of framework issue. In my Smashtag project, the Linked Frameworks and Libraries section has Twitter.Framework, and it's "required", and in Smashtag's Frameworks folder contains Twitter.xcodeproj, and nothing is red or giving any errors or warnings. Can someone tell me what I'm doing wrong? Thank you.
(I tried removing and readding the framework, didn't help)
First, convert the Twitter framework to the Current Swift Syntax (Edit menu, Convert item, you then still have to update the asPropertyList dictionary type in User.swift from AnyObject to [String: Any]).
Then, be sure the Twitter framework also appears in the Embedded Binaries section of the Smashtag project (as it does in the Linked Framework and Libraries section).

DYLD issue - "reason: image not found"

Weirdest SOB ever…
When i run my app on my iPhone it works perfectly. Also on lots of other iPhones. But when I try to run it on my friends iPhone (5.1.1), it starts and gets stuck immediately with the following error:
reason: image not found
Also it says it couldn't load Adsupport library. Could it be that 5.1.1 doesn't support Adsupport framework? Really?
Just solved it, although i would really like an answer. I deleted the Adsupport framework and now it works.
I don't know what image he was talking about… Really weird.
What framework does 5.1.1 use for such things?

How to solve the errror "image not found"?

I am working on universal project(iPhone/iPad), in which the code that I used is same on iphone and ipad. The code is working well in iphone and not working in iPad.
It returns the following error.
dyld: Library not loaded: /System/Library/Frameworks/AssetsLibrary.framework/AssetsLibrary
Referenced from: /Users/mac/Library/Application Support/iPhone Simulator/3.2/Applications/AFE91FFD-27A4-41A9-B5AF-C4336F10A9F3/Move On Inspirational Quotes.app/Move On Inspirational Quotes
Reason: image not found
Can anyone please tell me how to solve this error.
As the AssetsLibrary framework is present only on iOS 4.0 and later, trying to run an application that uses it on earlier (i. e. 3.XX) iOSes will result in a crash. Either try eliminating the use of this framework from your application, or move on and support iOS 4.0 and later only.

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.

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