Questions tagged [objective-c]

Utilize this specific tag solely for inquiries related to Objective-C features or reliant on code written in the language. The tags [cocoa] and [cocoa-touch] are designated for questions pertaining to Apple's frameworks or classes. For matters specific to certain platforms, such as iOS, macOS, Apple Watch, or tvOS, make use of the associated tags [ios], [macos], [apple-watch], and [tvos].

Error in retrieving Facebook JSON feed: Unable to insert object at specific index due to null value

I'm having some trouble parsing a Facebook Page Json Feed into a table view. I followed a tutorial on it here, but now I'm encountering this error message: "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSArrayM ins ...

Ways to transform a JSON string into an NSString using a specific key

I have a NSDictionary with the following JSON string: { "119": { "name": "Tidy The House", "url": "https://www.website.com" } } Is there a way to extract the name from this JSON string? ...

Deciphering unique characters within JSON syntax

I am currently using NSJSONSerialization to parse JSON data. NSData *jsonData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"url"]]; NSError *jsonError = nil; id jsonObject = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMu ...

"Implementing a UITableView alphabetical index feature for efficiently displaying vast amounts of

My current project involves loading data from a webservice that returns JSON data into a table. To handle the large amount of data in the database, I implement dynamic loading when the user scrolls down. One challenge I am facing is whether it would be fe ...

Obtaining JSON data from a PHP script using Objective C

Creating an application that utilizes PHP to pass JSON files. The PHP code generates a JSON result like this: {"files":[{"name":"sharing-config.txt","date":"28-11-2014-11-59-59"},{"name":"2.jpg","date":"28-11-2014-14-25-35"}]} Now I need help calling the ...

Objective C - Organize JSON data into groups

I will attempt to explain my idea and what I hope to achieve. Here is the JSON structure: { "objects": [ { "title": "Title #1", "date": "1446930000" }, { "title": "Title #2", "date": "1437782400" }, { " ...

Decipher a complicated JSON object

Encountered an issue at work involving parsing a JSON file to populate a table. Struggling with extracting specific data from the JSON. Here's a snippet of the code: NSData *jsonData = [NSData dataWithContentsOfURL:url]; NSDictionary* json = [NSJSONSerial ...

Exploring objects recursively in Objective-C

I am working on converting a variety of JSON objects into structured objects and need to iterate through all the nodes to process them hierarchically. Despite my initial belief that JSON framework only supported conversion to an NSDictionary, I soon realiz ...

PHP is used to download JSON data in mobile applications

My iOS and Android app is designed to download data from a database using JSON and PHP. The process involves numerous mysql queries that retrieve information from my MySQL database. Initially, I created an array in PHP to store all the queries and would ac ...

Difficulty sourcing a power supply

I've been facing some difficulties with referencing my outlet. Even though I managed to get the drag and drop feature working, thanks to a helpful member on stackoverflow, I still can't seem to make this outlet function properly. class controller(NSWindow ...

Discover the process of parsing JSON in Objective C using SBJSON

Can you provide guidance on how to pass a JSON String that has the following structure? {"lessons":[{"id":"38","fach":"D","stunde":"t1s1","user_id":"1965","timestamp":"0000-00-00 00:00:00"},{"id":"39","fach":"M","stunde":"t1s2","user_id":"1965","timestamp ...

Discover the steps to download web page data using Objective-C while ensuring that JavaScript has finished executing

I attempted something similar: NSString *url = @"http://www.example.com"; NSURL *urlRequest = [NSURL URLWithString:url]; NSError *error = nil; NSString *htmlContent = [NSString stringWithContentsOfURL:urlrequest encoding:NSUTF8StringEncoding error:&e ...

Sending JSON data to a targeted object in iOS

After reading numerous posts on Stack about POSTing data in XML and JSON, I am still having trouble finding specific information on how to update a selected object. I am successfully retrieving data from my boss' job tracking API and everything seems to b ...

Experiencing troubles with NSJSONSerialization. An erroneous JSON object has been transmitted to the

Within my xcode project, I have implemented a functionality that involves sending a post request with JSON data to an API. To achieve this, I am utilizing the Unirest library: NSDictionary *jsonObj = @{@"access_token": accessToken}; UNIHTTPJsonRespon ...

Encoding a string for use in a URL

After receiving a JSON data object, I extract a string from it using the following code: NSDictionary *jsonDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 ...

Using iOS to send a request - Receiving a response with a 304 HTTP status code from

I am currently in the process of developing an application specifically designed for iPad users. To create this app, I am utilizing Express and a restful approach as the backend framework. The code snippet below demonstrates how Express should respond on t ...

Setting parameters to Labels in Objective-C it is important to have unique

As someone new to iOS Programming, I have encountered an issue with assigning values to labels. Below is the data I receive from a service: ( { EmpName = Peter; Relation = SouthAfrica; }, { EmpName = Smith; Relation = WestIndies; }, { ...

Generate a JSON string that determines the precision of numbers using the key IOS OBJ C

In order to enhance the efficiency of uploading JSON data from an IOS app to the backend server, there is a need to optimize the size of the JSON encoded packet, which is currently approximately 5MB. However, most of this data consists of doubles with exce ...

Reading various JSON files in Objective C

In short, I need to access only the parent element in the JSON file. How to parse multiple JSON in Objective-C?) I am trying to extract the author > NAME from this JSON. The code for this task is as follows: NSURL *blogURL = [NSURL URLWithString:@"*remov ...

How can I use PHP's openssl_encrypt() function in Objective-C for iOS development?

I am attempting to utilize the openssl_encrypt() method from php in iOS Objective-C. In order to do so, I have written the following code snippet: #import <CommonCrypto/CommonHMAC.h> #import <CommonCrypto/CommonCryptor.h> - (void)v ...

Looking to access Microsoft Project files (.mpp) on an iPhone or through Objective-C development?

Looking to pull data from a Microsoft Project file (.mpp) and display it on a UITableView. After extensive searching, I have not been able to find a solution for this task. While there are apps on the app store that can do this, I am unable to figure out h ...

what is the best way to display camera view in full screen on an iOS application?

What method should I use on an iPhone to launch the camera in full screen mode? Additionally, how can I overlay a compass on top of the camera view on iOS? ...

Tips for showing the parsed JSON data in a TableView using a TextField

Hello there, I am just starting out with iPhone development and need some guidance. I'm currently working on incorporating a webservice to fetch JSON response strings, parsing them using JSONvalue and displaying the parsed data on labels through buttons.. ...

Utilizing multiple UILocalNotifications simultaneously

Hey there, I've encountered an issue with using UILocalNotification. I'm receiving notifications from a server and storing the data in a MutableArray. Here's a snippet of what it looks like: idnoty * id of notification titlenoty * title of ...

Methods for Hiding and Revealing a UIView with the Press of a Single UIBarButtonItem

In my iOS app, I have created a right bar button item programmatically and added it to my view controller. Additionally, I have also added a UIView to the view controller. The action for my bar button item has been set. Currently, the UIView is hidden when ...

How can I pass an Objective-C object to JavaScript?

Currently, I am working on a UIWebView project that involves HTML and JavaScript. One of my friends is working on something similar but for Android. The challenge I'm facing is that in Android, there is a simple way to send an Android object to JavaS ...

Transforming JSON data into Java objects is seamless with the JSON to Java Object Mapper that integrates smoothly with J2objc

Currently, I'm utilizing the org.json.* classes from the j2objc distribution for handling JSON objects in my DTO classes. The mapping between my DTO classes and JSON Objects is done manually at the moment. I am aware of GSOn and Jackson as other options. ...

Posting JSON data to a WebApi Controller in Objective-C

I'm working on implementing a javascript function that sends data to an ASP.NET Web Api controller. Here's the code snippet: var d = { NorthEastPoint: { Latitude: boundingBox.ne.lat, Londitude: boundingBox.ne.lng }, S ...

Sending JSON data using RestKit POST method

I'm currently working on developing an iOS App for my school. In order to run some statistics later, I have implemented a database and created a Restful Web Service to handle all the necessary functions. To access the Web Service, I am utilizing RestKit. ...

Does Objective C have a counterpart to the encode() method in JavaScript?

NSString *searchString = @"Lyngbø"; NSLog("%@",[searchString stringByAddingPercentEscapeUsingEncoding:NSUTF8StringEncoding]); The result is: Lyng%C3%B8 <script type="text/javascript"> document.write(escape("Lyngbø")); </script> The result ...

Searching text on an iPhone using regex patterns

Currently, I have been utilizing the following regular expression: <li class=\"b_algo\"><h2><a href=\"(.*?)\" In my search within NSString, I am interested in modifying this search to also include : <li class=\ ...

Turkish text is not appearing correctly on the UIWebview when embedded in HTML

One of the challenges I encountered in my iOS project involved programming a UIWebView to load content in both English and Turkish from a web service. To accomplish this, I formatted the HTML string with the necessary headers and saved it locally before pr ...

Tips for effectively incorporating NSOperation Queue in objective c

I have encountered an issue with the code below. I am utilizing NSOperationQueue to fetch post data from the server during the login process. My aim is to retrieve a response from the server 8 times. However, the implementation of NSOperationQueue seems to ...

Cookies are disappearing from WKWebView when making AJAX requests

We recently had a request from a customer to switch from using WebView to WKWebView. Their app utilizes native login, which involves 2 POST calls to their backend to retrieve various authorization cookies that are used in all HTTP/AJAX calls throughout the ...

Understanding JSON Dates

At this point, I find myself a bit puzzled with what I'm currently observing. To elaborate, the scenario involves me converting a MongoDate to JSON by utilizing PHP's json_encode function along with MongoDB functionalities. The resulting output c ...

Exploring the capabilities of JSONmodel by attempting to retrieve data from a server onto an iOS device

I've been working on integrating JSONmodel to retrieve data from my server to my iOS device. I have set up all the classes properly, but for some reason, it returns null after calling the URL. feed = [[Feeds alloc] initFromURLWithString:@"http://http ...

Obtaining the values from an NSArray in JSON format

I have been utilizing JSON Accelerator from Nerdery for converting JSON String to Obj-C classes. However, I'm encountering issues with retrieving the values from a JSON NSArray. Below is the JSON string: { "status": { "code": 200, ...

Invoking a class method in Javascriptcore on iOS

I'm currently trying to comprehend the inner workings of JavascriptCore. Initially, I attempted calling a single function. Now, my focus has shifted to invoking a function within a class. This is what my javascript code looks like: var sayHelloAlf ...

Python Objective-C/Objective-C: the instance methods for my IBOutlet objects are not properly retrieving the values, such as dateValue

I am currently facing a challenge in accessing the object values of my XIBs. I am particularly interested in retrieving the NSData object or value from the Date Picker in my preferences window to determine the selected date. My IBAction code snippet, trig ...

NSInvalidArgumentException' error: 'Unrecognized selector sent to instance of __NSCFString

Below is the code snippet I am referring to: The nameLabel text attribute is set as the UserFullName from the unknown_object array in dict_Details. And here is my response: The getUserReviewsResponse data shows a status code of 200 and includes an ar ...

Having trouble loading my array from JSON into the UITableView

The .h file includes @interface HomeTVC : UITableViewController @property (nonatomic, strong) NSArray *spotTitle; while the .m file contains #import "HomeTVC.h" @interface HomeTVC () @end @implementation HomeTVC - (id)initWithStyle:(UITableViewStyl ...

learn to extract json information from a php web service using nsserialization

Currently, I am tackling json parsing using nsserialization. My aim is to parse a json data in uicollectionview. Below is the JSON API data I am working with: { "result": "Successful", "data": [ { "id": "2", "product_name": "6" Round ...

Encourage your Facebook friends to join the app using either Objective C or PHP!

While this question may have been asked in the past, I am curious to know if there have been any new developments in Facebook's API that would allow for specific functionalities. Is it feasible (with permission from Facebook) for a user to programmaticall ...

Documentation for RestKit JSON Metadata Response Descriptor

Upon receiving a JSON response containing a list of objects and a timestamp value labeled as "MetaData," the data structure looks like this -- { "access_time": 1416467865510, "profiles" : [ { "user_id": "bbb91ae431b", "email": "&l ...

Failed to transmit data to the CouchDB database

When attempting to execute this code for sending data to my CouchDB database, I encountered the following error: 2015-06-04 15:30:43.426 ddd[8303:640525] requestReply: {"error":"bad_request","reason":"Referer header required."} Is there a way to resolv ...

Retrieving a single attribute from a JSON reply

I struggle with understanding JSON. It all seems like gibberish to me. Here's an example of my JSON response: { ID = 1; EDate = "<null>"; SelectedDay = "/Date(-62135596800000)/"; End = "14.09.2013 15:00:00"; Start = "14.09 ...

approaches for retrieving a specific JSON value associated with a key in Objective-C

I've recently started learning Obj-C and I'm struggling with getting the output of a JSON-Request. I think the issue lies in my understanding of arrays, dictionaries, and syntax. It would be really helpful if someone could guide me in the right direction. ...

The JSONModel does not yield any results

I am utilizing JSONModel to retrieve JSON data from a specified URL. This object is quite basic, with only two strings - "name" and "url". Initially, I created the Object Model: @protocol Tutorial @end @interface Tutorial : JSONModel @property (nonatomic ...

What is the best way to extract JSON data that has already been double quoted in Objective-C?

Can you help me with parsing JSON data that is already double-quoted? For example, say we have received the following JSON: "first_name" = Noah; Here is the code I have tried: //"first_name" = Noah; NSString *name=[result valueForKeyPath:@"first_name"] ...

Empty results returned by iOS AFJSONRequestOperation

When attempting to fetch data via a JSON request using AFJSONRequestOperation, I encounter an issue where I am able to retrieve the data successfully but unable to seamlessly proceed with the request and pass on the data for further processing. Below is t ...

What is the recommended dispatch_async method for populating a table view controller with JSON data?

I have some JSON data that I need to display in a table view. What is the best approach for fetching and loading this data in the background using dispatch methods or child threads? ...

AFNetworking failed to correctly deserialise a JSON-encoded dictionary within another dictionary

While working on my PHP backend, I have a situation where I am returning JSON data in the following format: $results_array=array(); $stmt->bind_result($IdUser,$username); while($stmt->fetch()) { $r ...

Techniques for parsing a String in Objective-C

I am looking to parse a string to replace certain elements within it. If the string contains an <ol> tag, I want to specifically focus on replacing the <li> elements with numbers. I understand that I can utilize the rangeOfString method to c ...

Which method is best for extracting content from a WebView - using Regx, implementing JQuery, or utilizing HTML parsing?

Criteria for Acceptance I am working with a website in a WebView that is not under my ownership. I want to be able to trigger native button clicks based on the content of the page. Tasks at Hand I need to determine if the HTML content contains specific UR ...