iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

issue with getting data from url

Here is the code I wrote NSString *str = [NSString stringWithFormat:@”https://graph.facebook.com/me?access_token=CAADbwxRRgq8BANULcGGn3d4NPZB4LlP3tCL9YjYH3Nd0fD2XvgjG0qTECEmOsFhNhcu4NCdgYzQK3lYaATiedLRP4ZAIRgf8FBtDBYd22z5BrMabHlex12nZAbm8UfJTrPVRw5rjN8abi9″]; NSURL* url = [NSURL URLWithString:[str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSError* error = nil; NSData* data = [NSData dataWithContentsOfURL:url options:NSDataReadingUncached error:&error]; if (error) { NSLog(@”%@”, [error localizedDescription]); } else { NSLog(@”Data has loaded successfully.”); } I got the error Error Domain=NSCocoaErrorDomain Code=256 “The operation couldn’t be completed. (Cocoa […]

On Objective-C/Cocoa Key-Value coding and arrays

I’m trying to work out the “correct” way to handle populating an array with key-value coding for an iPhone app. I’ve come up with something that works, but it’s fairly hackish. Basically I’m parsing an XML document into a set of code-generated models. Let’s assume the XML is of this format: <foo> <bar> <item name=”baz” […]

Clickable UISlider

I’d like to make my UISlider clickable – to change the value on click to “blank space”, e.g. It’s set to zero, I click in the middle of the slider and it will “jump” to the middle. Is there any way how to do this?

how to add custom keyboard

I did a simple application. My application contains 10 Text fields. what i need is i need to hide default keypad i place manual keys like this How can i done this keys works as a keypad to my app. can any one pls post some code or link. Thank u in advance.

How To Store JSON Parsed Data Into Plist Using Objective C?

I need to store JSON parsed data Into propertylist like below structure using objective C. My JSON Response From Server : {    “response”:{       “A”:{          “name”:”Arun”,          “age”:”20″,          “city”:”SFO”,  “subject”:2       },       “B”:{          “name”:”Benny”,          “age”:”20″,          “city”:”SFO”,  “subject”:1   },       “C”:{          “name”:”Nani”,          “age”:”30″,          “city”:”SFO”,  “subject”:0       }    },    “inprogressdata”:{    },    “dataspeed”:”112 milliseconds…” } I am trying like below storage method into propertylist. […]

Method signature for a Selector

I’m new to the Objective C business (Java developer most of the time) and am woking on my first killer app now. 🙂 At the moment I am somehow confused about the usage of selectors as method arguments. They seem to be a little bit different than delegates in C# for example. Given the following […]

IOS Static library how to, and issues

I read about IOS static library creation/issues in many posts, StackOverflow questions, blog and so on… but now i’m really confused 🙂 Why not to create a unique question to understand this argument and avoid to move across 100 different resources ? I try to merge here some major questions about static library: How to […]

Objective-C: Sort array using arguments

I’m trying to sort an array passing an argument to the selector. For instance, I have an array of locations and I want to sort this array based on the distance they have from a certain point (for instance, my current location). This is my selector, however I don’t know how to call it. – […]

Measure time between library call and callback

Hi: In an iPhone application I use a library(C++) which asynchronously makes a callback when computation is finished. Now I want to measure the time which is spent -including the method which calls the library- until the callback is made. Are there any possibilities to do this with the Instruments application from Apple? What are […]

Core Data – Basic Questions

I would like to know how the following works in Objective-C in my header file i have the following which is initialized from a different view controller @interface UserLookup : UIViewController { NSManagedObjectContext *referringObject; } and in my implementation file i have to pass this NSManagedObjectContext to 2 child view controller then does it make […]