Posts

Post not yet marked as solved
0 Replies
401 Views
I removed my app from sale when Apple informed me it had to be updated. A few days ago I updated the app and submitted it for approval. It was approved shortly thereafter. On the App Store Connect page for the app, I clicked the Availability button for "All regions" and set the price to "Free". But 24 hours later, I'm still seeing "Removed from sale" displayed on that page. How can I get the app back on sale?
Posted
by Albinus.
Last updated
.
Post marked as solved
4 Replies
2.1k Views
This is what I've been doing to change a single letter at a specific location in a word:let word = "abc" var letters = Array(word.characters) letters[1] = "x" let newWord = String(letters)Surely there's a more elegant way in Swift 3. But is this really it?let index = word.index(word.startIndex, offsetBy: 1) let range = index ..< word.index(after: index) word.replacingCharacters(in: range, with: "x")It works; but it looks hideous.
Posted
by Albinus.
Last updated
.
Post not yet marked as solved
0 Replies
263 Views
I'm using a TextField in SwiftUI to enter regular expressions in an iOS app. But when I enter three dots (...) into the field, they are automatically converted to a single Unicode character. This does not create the regular expression I want to use. I've added .disableAutocorrection(true) to the text field, but the auto substitution still occurs. Is there some way I can prevent this from happening?
Posted
by Albinus.
Last updated
.
Post marked as solved
5 Replies
5.7k Views
I've been trying to save the output of a macOS app to my desktop. This is the code I'm using to do so:let homePath = FileManager.default.homeDirectoryForCurrentUser let desktopPath = homePath.appendingPathComponent("Desktop") print(desktopPath) let filePath = desktopPath.appendingPathComponent("TestFile.txt") do { try unicodeString.write(to: filePath, atomically: false, encoding: .utf8) } catch { errorMessage = error.localizedDescription + "\n" + unicodeString }And this is the error I get: You don’t have permission to save the file “TestFile.txt” in the folder “Desktop”.The path that's printed looks like this: file:///Users/DKJ/Library/Containers/com.hatzicware.FileCreator/Data/Desktopwhich of course is not on my desktop. How do I construct a path that will let me save the file?I get the same error running the app both in Xcode, and on its own in Finder.
Posted
by Albinus.
Last updated
.
Post marked as solved
12 Replies
7.5k Views
Since updating to Xcode 11.0 yesterday, I've been unable to upload my app. The only error message I get is "App Store Connect Operation Error". Nothing else shows in the log.Previously (i.e. using Xcode 10) I uploaded several archives of this same app without any trouble. The current archive was created with Xcode 11, and validates without any complaints.Is anyone else having this problem at the moment? When I google about it, I see that it has occurred periodically in the past when Xcode has been updated.P.S. The error occurs consistently during the upload process, when Xcode is waiting for a response after sending API usage data.
Posted
by Albinus.
Last updated
.
Post marked as solved
3 Replies
1.4k Views
I'm developing a macOS document-based app in Swift, using Xcode 11.6 and the template it provides. I often use Swift print() statements during development to see what's going on as the app runs. But when I try to put one of these in the Document.swift template file, I get errors: Cannot convert value of type 'String' to expected argument type '[NSPrintInfo.AttributeKey : Any]' Missing argument label 'withSettings:' in call Missing arguments for parameters 'showPrintPanel', 'delegate', 'didPrint', 'contextInfo' in call I don't get these errors when I put a print() statement in the AppDelegate.swift or ViewController.swift files. Can someone tell me what the problem is here?
Posted
by Albinus.
Last updated
.
Post not yet marked as solved
2 Replies
1.5k Views
Has anyone found a reliable way to use a custom framework they're building within a playground? I've found two or three different methods via Google (adding playground to framework project, adding both framework project and playground to a workspace, etc.) but I haven't got any of them to work so far: I always get a "can't find module" error when I try to import the framework into the playground.For the time being, I'll try building a test project, and drag my framework in there every time I make a change.
Posted
by Albinus.
Last updated
.
Post not yet marked as solved
0 Replies
386 Views
I have just received an email stating that my iOS Distribution Certificate will expire in 30 days. I looked at my account's certificate page, and I see this certificate there. But I also see two plain Distribution Certificates marked "ALL" for platforms, with identical expiration dates in 2021. (1) Do I need to renew the iOS Distribution Certificate in order to upload new iOS apps to the App Store? (2) Why do I have two identical copies of that generic certificate? The answer to (2) may well be that I screwed up the certificate process, since I'm not entirely sure how it's all supposed to work.
Posted
by Albinus.
Last updated
.
Post marked as solved
1 Replies
957 Views
I'm working on an iOS app that will allow users to choose files to download from my server. These are all simple JSON files that are used to display Greek texts. Since many of these files are very large, I want my users to be able to pick which ones they want to have on their device.I was thinking of finding some external directory-listing template code from the internet, and just using a table view to list the files. But now I've discovered the existence of UIDocumentPickerViewController. Would this be a good choice for my purposes? Or would it needlessly complicate things? Any suggestions for good code snippets for connecting to and downloading from my server would also be much appreciated!
Posted
by Albinus.
Last updated
.
Post marked as solved
6 Replies
4.4k Views
My iOS app displays text content loaded from data files. Some of these data files will be bundled with the app. Others will be downloaded from my server. They are all JSON files, and have the same structure.I want all of these data files to be placed in the same directory. So far, I've just been dragging the bundled files into an Xcode group folder. How would I create a special directory for them? i.e. one that would be part of the directory structure of the app itself?What I'd like to do is have a directory called Data where both bundled and downloaded data files would reside.
Posted
by Albinus.
Last updated
.
Post marked as solved
16 Replies
8.7k Views
Here's one for the regular expression aficionados. I have some strings containing full stops. I want to remove these when they occur immeditately between two other characters, as in "a.2" or "1.2.3". But I don't want to remove them at the end of lines.I presume I'll have to use regular expressions to do this, and I think I know how to write one that will match those characters (although it looks so ugly I'm ashamed to post it here.) But I can't figure out how to use it to filter my strings. Suggestions would be welcome.
Posted
by Albinus.
Last updated
.
Post marked as solved
3 Replies
996 Views
There's a dictionary app (Logeion) that I want my app to open. When the user hightlights a word in my app, and presses the Dictionary toolbar button, the dictionary app should open with the dictionary entry for the highlighted word displayed.This is exactly what happens so long as the highlighted word has only ascii characters. But when the word has unicode characters, the dictionary opens, but the entry for the word is not displayed.I know that URLs will not accept unicode characters as-is, so I tried escaping them with this code:let escapedString = selectedText.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" let logeionURL = URL(string: "LogeionLookUp://" + escapedString) if let url = logeionURL { UIApplication.shared.open(url, options: [:], completionHandler: {success in print(url, "\n", success)}) }The selectedText variable is a String that holds the text that the user has highlighted. (Yes, I've checked.) I've tried a few other values besides .urlPathAllowed in line #1, but without effect. I know that the url is valid, because the app does open and the completionHandler runs, even with unicode strings. Is there some other way to get uincode characters into the URL? I know that the dictionary app will work with unicode characters, because I've seen another app do precisely what I want my app to do with them. Apart from "Ask the app developer how they did it", any advice would be appreciated!
Posted
by Albinus.
Last updated
.
Post marked as solved
1 Replies
4.0k Views
I keep getting these errors when I try to validate my app archive in Xcode's Organizer:Automatic signing is unable to resolve an issue with the "MyApp.app" target's entitlements.Provisioning profile failed qualification: Profile doesn't match the entitlements file's values for the application-identifier and keychain-access-groups entitlements.I can't understand this error at all. I'm trying to find a way to edit my profile, but so far without success.Can someone explain to me what's going on?
Posted
by Albinus.
Last updated
.
Post not yet marked as solved
6 Replies
627 Views
Here's one for the "What-the-****-is-it-now?" department. I have a simple view that has some details about my iOS app that I want to display when a toolbar button is touched. The UIViewController is called "AboutViewController". I put a view controller into a storyboard and set its class to AboutViewController. Here's the toolbar button code in the superview controller that loads it:let aboutVC = storyboard.instantiateViewController(withIdentifier: "About") aboutVC.view.frame = CGRect(x: 0.0, y: 0.0, width: 200, height: 300) self.view.addSubview(aboutVC.view) aboutVC.view.center = self.view.centerI put a "Dismiss" button into the controller instance in the storyboard and connected it to this code in AboutViewController: @IBAction func dismissButton(_ sender: Any) { self.view.removeFromSuperview() print("Dismiss button touched.") }When I press the toolbar button, the subview is displayed in the centre of the superview, just as I expected. But when I press the Dismiss button in the subview, nothing happens. The message isn't printed either. I've checked and rechecked that the connection between the button and the IBAction is set.It seems to me I've done this same damned thing many times before and had no problem. What the **** is wrong now?
Posted
by Albinus.
Last updated
.
Post not yet marked as solved
4 Replies
2.3k Views
I may have been dreaming, but I have a distinct memory of an Int property that does this:let one = 1.propertywhere one would be set to the string "one". I have been googling for ages and can't find any reference to it. I've tried 1.description, but that just comes out as the string "1".
Posted
by Albinus.
Last updated
.