Is there a class to parse JSON from a server in the iOS SDK? (similar to NSXML for XML and by extension RSS.)
As of iOS5 JSON is been natively supported, no need for 3rd party frameworks.
This is supported by the NSJSONSerialization Class!
Updated answer for iOS 5:
JSON support is now native to iOS with NSJSONSerialization, but in terms of performance, it pales in comparison to JSONKit, as John Englehart stated in the JSONKit README:
UPDATE: (2011/12/18) The benchmarks below were performed before Apples NSJSONSerialization was available (as of Mac OS X 10.7 and iOS 5). The obvious question is: Which is faster, NSJSONSerialization or JSONKit? According to this site, JSONKit is faster than NSJSONSerialization. Some quick "back of the envelope" calculations using the numbers reported, JSONKit appears to be approximately 25% to 40% faster than NSJSONSerialization, which is pretty significant.
Here's a blog post which delves into more specific benchmarks: JSON Libraries for iOS Comparison
There are several JSON libraries for the iPhone listed in this thread:
https://stackoverflow.com/questions/286087/best-json-library-to-use-when-developing-an-iphone-application
NextiveJson is supposed to be quite a fast lib for iOS JSON
NextiveJson
Regarding JSONKit benchmarks, for the current moment and iOS version it's not so fast. After creating test application for testing speed NSJSONSerialization is faster but not so fast as custom implementation OKJSONParser
Related
I have created one app in iOS5.
I want to store and retrive data on web server.
For that I want to use JSON parser.
I have used demo given by ray wenderlich for ios4. I heard that for ios 5.Some ready made frameworks are there.So can anybody having any idea regarding this?
I am using sqlite for data storage.
Please Help.
You may want to refer to SBJSON Framework which is frequently used for objective-C, I have used this framework in may of my iOS Apps.
You may get a reference about it from these links:
https://github.com/stig/json-framework
http://stig.github.com/json-framework/
Example Code: Also here is an example on, How to parse JSON with SBJSON Parser:
How to parse JSON into Objective C - SBJSON
http://jasarien.com/?p=428
Here is how you need to configure SBJSON into your app:
http://deshartman.wordpress.com/2011/09/02/configuring-sbjson-framework-for-xcode-4-2/
Hope this helps you.
Since you are a RayWenderlich Fan, They have a pretty amazing tutorial out there on the new iOS5 JSON Parser
I suggest you to used Twitter Framework for json, it's really easy to learn json, and you just have to used api of twitter, here is the all api available for twitter,
http://dev.twitter.com/console
I've started looking on the subject of Acoustic Fingerprint (http://en.wikipedia.org/wiki/Acoustic_fingerprint) for a pet project of mine for the iOS and I was wondering if there are:
Any opensource libraries or source code for the iOS that handle this?
Assuming I'm a veteran jack of all trades coder, is it very problematic to implement this myself if there is no open-source versions?
Will the Accelerate DSP library in iOS able to handle such a task?
Thanks
you may want to check out the EchoPrint CodeGen library by The Echo Nest. They even have a fully functional iOS code example.
You can find some additional links to open source audio fingerprinting related software in this MusicBrainz article, but AFAIK the EchoPrint library is the only one that has a license that is compatible with iOS apps.
Good Luck!
Not of my knowledge
No problem for a veteran, that won't be easy, but achievable.
Never looked into.
Even in java, this might be an interesting reading.
Before doing anything, especially if you intend to sell on AppStore, take care that these techniques/algorithms are patented. Read what happened to the above blog post writer.
Will the Accelerate DSP library in iOS able to handle such a task?
NO
I also notice that you put the tag "voice recognition". Just to make sure voice recognition as nothing to do with audio identification/acoustic fingerprinting !!
Does the iPhone 3G supports the functions of the AVCaptureVideoDataOutput class? Or is it limited cause of the lack of the video feature?
Yes it does, it runs on 4.0 and higher. Here's some (buggy) Apple sample code AVCam to run and play with. Also, if you're thinking of making something serious, here's a nice post explaining what's wrong and can be done better and simpler with AVFoundation framework.
I am making an iphone application.
I am a newb.
I want to fetch the data from my website. What should i do to implement this?
What needs to be done?
Help me please
Thanks
Any tutorials would be of great help.
If your problem is getting data from website to iphone then you can just use JSON Parsing to get data.
Just you have to pass all the data as JSON string in iPhone from your website. And then parse the data once received into your iPhone.
Here you can refer to this link
http://www.raywenderlich.com/5492/working-with-json-in-ios-5
Hope this helps you
You will be using the NSURLConnection, NSURLRequest and NSURL classes here is an example from Apple; http://developer.apple.com/library/mac/ipad/#documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html
Expose your data from your site as WebService, XML, JSON etc. Consume that using iPhone app.
Which language is being used your site?depending on that some sample could be provided.
Chapter 10 of James Kennard, Mastering Joomla! 1.5 : APIs and Webservices contains 8 pages about XML-RPC.
For real-live examples, search the Joomla! Extension Directory.
http://extensions.joomla.org/extensions/search/xml-rpc
Here is another one to kick-start http://www.slideshare.net/coolparth/rest-api-for-joomla
For the server side, I suggest using a web service to send the data to your client.
ORIGINAL AUTHOR'S REVISION:
The September issue of Linux Journal has an excellent article on writing mobile apps that work for Android AND iPhone/iPad using free tools and frameworks. Here is a link to the article online:
Developing Portable Mobile Web Applications
Previous answers suggest using NSURLConnection, but I find it to be a bit cumbersome to use on its own. I suggest using something that wraps NSURLConnection (or CFNetwork). Some examples: ASIHTTPRequest (CFNetwork-based), httpriot and Seriously (NSURLConnection/block-based).
I want my app to read a XML via internet.
Also I want to keep the previously download xml so next time I may not need to download again until certain hours is passed or whatever period of time according to settings.
Do you recommend me to download it first and store locally before process it? Or should I process it while downloading (with libxml2 I guess)?
What do you usually with apps using remote XML?
Targeting 3.0 devices btw.
The libxml2 library has a SAX parser that you can use to process XML as it comes in, to reduce memory usage. If you use the DOM parser, you have to store the entire document in memory, which can be an issue for iPhone and iPod Touch devices.
Take a look at Apple's XMLPerformance sample application, which demonstrates how to use the SAX parser. It's a bit more complicated than the DOM approaches, but it will be faster and use less memory.