Posts

Post not yet marked as solved
1 Replies
1.3k Views
I'm getting the dreaded "Failed to prepare the device for development" error when I connect my iPhone running iOS 15 to the latest version of Xcode. I've tried rebooting both devices. How do I fix this?
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
3 Replies
10k Views
We have an auto-renewable subscription in our app that we want to stop offering. However, we want to make sure that people who have already purchased the subscription remain subscribed until the end of their current subscription period (and are subsequently unsubscribed and not charged further). What is the right way to do this?We tried submitting the app with the subscription still enabled in App Store Connect but hidden in the app, and our update was rejected because the reviewer couldn't find a way to subscribe.Thanks,Frank
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
1 Replies
527 Views
Do string functions such as "replacingOccurrences" and "trimmingCharacters" always return a new string, even if the old string did not need to be modified? In other words -- if I'm doing a large number of "replacingOccurrences" in my app but only a small number of the strings actually contain the sequence I want to replace, should I check to see if the sequence exists before calling replacingOccurrences, in order to avoid an unnecessary string allocation? I would guess that Swift would return the same string if it didn't require any modifications, but the documentation just says "Returns a new string". Thanks, Frank
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
0 Replies
443 Views
How do I disable the predictive text feature (word suggestions) of the keyboard when used with a UISearchBar?
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
0 Replies
382 Views
I want to customize or limit the typing suggestions for a UISearchBar input to a list of known words that exist within the material that is being searched. How is this done? Thanks, Frank
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
10 Replies
26k Views
Hi,I have an app that was approved and is "Pending developer release".While we were waiting to release the app, someone found a bug that we'd like to fix.Unfortunately, I can neither upload a new version of the app, nor create a new version in iTunes Connect (the option to add a new iOS version is disabled).Is there any way to revoke the approved version without releasing it to the app store? I don't mind having to wait for Apple to review the updated version again.Frank
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
0 Replies
499 Views
Views A and B are equal in width (set up via a constraint). The actual width will vary at runtime. What I want to do is arrange view A such that it is horizontally centered on B but offset to the left by 1/10th of the total width. In other words, if views A and B were 100 units in length, I'd want A to be positioned 10 units to the left of B. If the width were 150 units then the A position would be 15 to the left, etc. I thought I could do this with either a leading constraint or a centerX constraint using a multiplier of 0.9, but it isn't working out the way I want. What's the best solution?
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
1 Replies
725 Views
I can't get my latest iPhone app to run in portrait mode only. In Xcode I've checked only the box that says "Portrait" under Device Orientation, and I've also examined the Info.plist file to ensure that there aren't any hidden settings for other orientations. I've also tried checking or un-checking iPad, and checking "Requires Full Screen" when that option appears. No matter what I do, when I run the app on my phone and rotate the screen, the interface rotates. What am I doing wrong?
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
1 Replies
393 Views
I've got an iOS project that I've been working on for some months. Just recently, I started seeing a compiler error to the effect that "Referencing instance requires that X conforms to Equatable". It shows up in places where you'd expect something to be Equatable, such as the argument to firstIndexOf: on an array. The class in question is written in Swift, but descents from an Objective-C base class. I know there are some issues with how Equatable interacts with Obj-C but I think I've done it right. The base class extends NSObject, and the subclass implements both the isEqual function and the static == function. (I don't think the latter is necessary but I included it just in case). I've tried explicitly including "Equatable" in the definition of the subclass but the compiler rejects this as "Redundant conformance to protocol". I'm not exactly sure how that works since NSObject doesn't extend Equatable but I guess Swift considers them equivalent. Here's where things get super weird though. Xcode still builds and runs the project despite the compiler error, and the code runs, and it works. I even put a breakpoint in the isEqual function to make sure it was getting called. Also, when I clean and rebuild the project, the compiler error often disappears for some time, reappearing hours or days later. So I think this must be some kind of bug in Xcode or Swift itself. What do you think? Frank
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
1 Replies
1.2k Views
I've got a fairly old app that I first built back in 2014, and have been maintaining over the years. One of the screens in the app uses the camera to scan barcodes. The barcodes we scan are printed on labels, and are in the org.iso.Code128 format. When the app was first developed, I simply set the metadataObjectTypes property of AVCaptureMetadataOutput to all available types. This worked fine. The app scanned our barcodes very quickly with almost no issues. In 2017, we started seeing issues where barcode scanning was becoming slower. I reasoned that having it configured to scan for every possible barcode format might be the issue, so I went in and changed the code to have it scan only for the org.iso.Code128 format. This helped, for a while. Now, we're seeing the problem again in iOS 14 devices. On some devices it is nearly impossible to scan the barcodes. On others, you have to wait 20 or 30 seconds before the barcode is recognized. What could be causing this issue?
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
19 Replies
29k Views
Will Apple continue to support it, or will we wake up one day to find that Swift is the only viable language?It's a serious question. Careers depend on it. I don't accept the "No comment" approach that Apple usually takes. It's cruel.I'm willing to put the time into learning Swift if I have to. I'm not going to do it if I don't. I want to know.Frank
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
0 Replies
354 Views
Is there any way to get Xcode to remember my Git credentials? My company uses a service called Beanstalk to host our Git repositories. Beanstalk is not one of the choices available under "Source Control Accounts", but the repository itself is a standard Git repository. I can access it by giving my credentials at the time I pull or push, but Xcode forgets them whenever I close it.
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
0 Replies
769 Views
Hi, I'm working with a BLE device manufacturer on a new device for which I'm tasked with developing the iOS app. The hardware developer told me: "In response to a Scan request (from a phone or other device) the BLE stack is configured to include a device identifier". The device identifier is something I need to see in the advertising packet before I connect to the device. I don't know what a "Scan request" is. Is this something I have to specifically ask for in my app? Is it something iOS does automatically? Thanks, Frank
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
1 Replies
718 Views
Hi,According to the documentation for the AVVideoCompositing protocol:"When creating instances of custom video compositors, AV Foundation initializes them by calling init and then makes them available as the value of the customVideoCompositor property of the object to which it was assigned. You then can do any additional setup or configuration to the custom compositor."AVMutableVideoComposition has a customVideoCompositorClass property, but does not have a customVideoCompositor property.Am I misunderstanding this? I need to access the instance to set some properties on it, but I cannot.Thanks,Frank
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
1 Replies
592 Views
I'm trying to send my app silent push notifications by setting the "content-available" flag to 1 in the notification payload. This works, but there is a problem: if my app is not running in the foreground, the notification is visible on the home screen. I don't want this: I just want the app to see it, without waking up the screen or alerting the user. If the app is open when the notification comes in, it works as expected; I receive the notification inside my app, and iOS does not display any alert or banner. I configured my app with the "Remote Notifications" background mode. What am I doing wrong?
Posted
by flarosa.
Last updated
.