How to generate JSON programmatically using JSON framework for iPhone
问题 I am creating an application in that I need to send a JSON to the server to get some response. How to generate JSON using JSON Framework for iPhone? What are the other possible ways? 回答1: Create an array or dictionary of objects representing the information you want to send via JSON. Having done that, send -JSONRepresentation to the array/dictionary. That method returns a JSON string, and you send it to the server. For instance: NSDictionary *o1 = [NSDictionary dictionaryWithObjectsAndKeys: @