nsurl Questions

1

When I open a URL (like this http://webserver/index.php/feeds/1.2/3.4/5/1000/) in my app via Xcode I get a nil JSON string returned. It doesn't even seem to be talking to the server. The exact sam...
Harbird asked 2/12, 2015 at 19:45

8

Solved

I have a URL coming in to the AppDelegate method: func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { } The URL looks like www...
Haskel asked 6/10, 2017 at 10:3

1

Solved

Currently I'm able to trash selected user files. The question is how to know whether the volume of that file supports trashing. For example, external USB sticks just have a local trash folder, whil...
Prayerful asked 23/12, 2015 at 10:35

39

Solved

I'd like to load an image from a URL in my application, so I first tried with Objective-C and it worked, however, with Swift, I've a compilation error: 'imageWithData' is unavailable: use object c...
Swiercz asked 15/6, 2014 at 16:27

13

Solved

I've been trying to use Corona SDK's Facebook API to post the score on the game I'm developing on facebook. However, I'm having a problem with it. During the first time I try to post to facebook, I...
Illuminator asked 18/4, 2013 at 2:27

2

Solved

I know that I can deep link into the Settings page on iOS via UIApplicationOpenSettingsURLString. However, this takes me to a page such as this: Now if I want the user to enable notifications, t...
Podolsk asked 7/10, 2015 at 23:11

6

I think I don't understand the concept of "baseURL". This: NSLog(@"BASE URL: %@ %@", [NSURL URLWithString:@"http://www.google.es"], [[NSURL URLWithString:@"http://www.google.es"] baseURL]); Prin...
Filum asked 9/4, 2013 at 7:20

7

I have a variable videoURL of type NSURL. If I call println(videoURL) it would return something like this: http://files.parsetfss.com/d540f71f-video.mp4 I have a button set up that should take th...
Thill asked 7/4, 2015 at 2:31

12

Solved

I have a URL in an iPhone application to work with. But the problem is that it has some spaces in the URL. I want to replace the spaces with '%20'. I know that there are the stringByReplacingOccure...
Damiendamietta asked 9/8, 2010 at 12:13

13

Solved

I have converted the code for making a phone call from Objective-C to Swift, but in Objective-C, we can set the type of the URL that we like to open (e.g. telephone, SMS, web) like this: @"tel:xx"...
Fellowman asked 16/6, 2014 at 19:59

7

I am making a music app with swift. The app lets users play music through their Apple Music subscription via their Apple Music app. I am able to check whether the user has an Apple Music subscripti...
Hoopoe asked 8/11, 2019 at 19:9

1

- bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error: Documentation states: This method returns bookmark data that can later be resolved into a URL object for a file ev...
Mule asked 1/11, 2015 at 15:49

8

Solved

I am using AFNetworking in my iOS app and for all the GET requests it makes, I build the url from a base URL and than add parameters using NSDictionary Key-Value pairs. The problem is that I need ...
Presto asked 3/12, 2015 at 8:9

3

Solved

Here is a fun issue I'm running into after updating to Swift 2.0 The error is on the if let url = URL.absoluteString line func myFormatCompanyMessageText(attributedString: NSMutableAttributedStri...
Altitude asked 24/9, 2015 at 18:18

6

Can I somehow do a synchronous HTTP request via NSURLSession in Swift? I can do an asynchronous request via the following code: if let url = NSURL(string: "https://2ch.hk/b/threads.json") { let ...
Littell asked 6/11, 2014 at 16:22

13

With all the URL-handling objects lying around in the standard Cocoa libraries (NSURL, NSMutableURL, NSMutableURLRequest, etc), I know I must be overlooking an easy way to programmatically compose ...
Stemware asked 5/4, 2009 at 5:51

1

Imagine this simple example of two paths on macOS: /etc/hosts /private/etc/hosts Both point to the same file. But how do you determine that? Another example: ~/Desktop /Users/yourname/Desktop O...
Subjunction asked 6/4, 2021 at 12:12

3

I have long been using +[NSURL fileURLWithPath:] because it's convenient, but in profiling I found that this was a source of bottlenecks because it queries the filesystem before calling down to +[N...
Tap asked 6/9, 2013 at 19:39

5

Solved

let testurl = "http://akns- images.eonline.com/eol_images/Entire_Site/2018029/rs_1024x759- 180129200032-1024.lupita-nyongo-angela-bassett-black-panther- premiere.ct.012918.jpg?fit=inside|900:auto" ...
Checky asked 2/2, 2018 at 5:39

1

In earlier versions of macOS, NSURL instances constructed from a security-scoped bookmark would have an ?applesecurityscope=... query string tagged onto the end of them. I was checking for this in ...
Vernitavernoleninsk asked 3/7, 2017 at 18:1

8

Solved

it may be very easy, but I don't seems to find out why is URLWithString: returning nil here. //localisationName is a arbitrary string here NSString* webName = [localisationName stringByAddingPerce...
Sapanwood asked 30/12, 2009 at 17:36

4

Solved

This is how I add query params to a base URL: let baseURL: URL = ... let queryParams: [AnyHashable: Any] = ... var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: false) componen...
Riotous asked 27/3, 2017 at 17:17

10

Solved

So I have converted an NSURL to a String. So if I println it looks like file:///Users/... etc. Later I want this back as an NSURL so I try and convert it back as seen below, but I lose two of the ...
Surrebutter asked 21/11, 2014 at 13:23

9

Solved

I need to load an image from a url and set it inside an UIImageView; the problem is that I don't know the exact size of the image, then how can I show the image correctly?
Sausauce asked 10/6, 2012 at 21:38

9

Solved

I am creating an app, and I have a banner which promotes my other app. This is my code: var barsButton : UIButton = UIButton(frame: CGRectMake((self.view.bounds.width / 2) - 51, self.view.bounds.h...
Fail asked 19/9, 2014 at 18:19

© 2022 - 2025 — McMap. All rights reserved.