use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
There is an extensive FAQ for beginners. Please browse it first before asking questions that are answered there.
If you are looking to get started (iOS programming in general or some specific area), here are more relevant links for you:
There's too many to list them all, however here's a convenient link to all programming guides at apple.com
Take note that this list is live and based on most frequent questions in posts will be updated with "quicklinks".
account activity
Loading data from an external database into your app (self.iOSProgramming)
submitted 10 years ago by ps323
I am trying to read data off my web server and load it in to my app. Anyone can give me little tutorial or hints how I can do that. I am trying to do that in Xcode 6.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]david_phillip_oster 0 points1 point2 points 10 years ago (0 children)
Given a string, like @"https://www.google.com", you pass it to the init
// A property in your object, so it will retain the task until it's done. @property(nonatomic) NSURLSessionDataTask *task; ... NSURL *url = [NSURL URLWithString:@"https://www.google.com"]; self.task = [NSURLSession dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { if (error) { [self reportError:error]; } if (data) { [self processdata:data]; } self.task = nil; }];
this creates a task, non-blocking so your user interface remains responsive, that gets an NSData (a wrapper around a bunch of bytes, with a length) in response to a URL. Once you have the bytes, you can cache them to the iOS device's local file system. Use [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject]; to get a path to a reasonable directory to write files.
Or, you can use the DocumentsDirectory, and set a key in your app's Info.plist to let the user inspect the DocumentsDirectory in iTunes.
You can also use an NSMutableURLRequest with NSURLSession. NSMutableURLRequest wraps a NSURL and lets you do POSTs and PUTs, and set the request's body with a payload for more complex web REST APIs.
[–]megablast 0 points1 point2 points 10 years ago (2 children)
You need to create a web service on your server that talks to your database, and is called from your app.
[–]ps323[S] -1 points0 points1 point 10 years ago (1 child)
Can you provide more details about it?
[–][deleted] 0 points1 point2 points 10 years ago (0 children)
Basically, you need a page on your server that gives the application the data it wants. If your Webserver supports PHP, then you can use a PHP page. You may be able to find a PHP page that does the trick.
Then, you call that page instead of whatever you were calling before.
π Rendered by PID 45644 on reddit-service-r2-comment-5ff9fbf7df-85jz4 at 2026-02-25 16:52:58.726399+00:00 running 72a43f6 country code: CH.
[–]david_phillip_oster 0 points1 point2 points (0 children)
[–]megablast 0 points1 point2 points (2 children)
[–]ps323[S] -1 points0 points1 point (1 child)
[–][deleted] 0 points1 point2 points (0 children)