Post not yet marked as solved
Since XCode 9, I've been seeing build errors hang around after they're fixed. It's very annoying because they obscure actual build errors.For example, a cocoapod was not in the right place, so the import statement was flagged. I fixed the dependency, ran the app, it ran fine, but the build error persisted for several more runs until I ran in a different simulator.Cleaning the build folder (even with OPTION key)did not help.Is there some other way to clear build errors?
Post not yet marked as solved
I am getting an error from the compiler:
Expression is 'async' but is not marked with 'await'
But the expression is not async.
Here's a minimalist example:
func testAsync() async -> String {
let result = App.instance.dataManager.getData() // ERROR: Expression is 'async' but is not marked with 'await'
...
async stuff here
...
return result
}
The error occurs on the first line of this function. But getData() is not async, nor is dataManager an async property.
I can get rid of the error if I get rid of the singleton instance property:
func testAsync() async -> String {
let dataManager = DataManager() // no error
let result = dataManager.getData() // no error
...
async stuff here
...
return result
}
But neither the singleton nor the instance property are async. If I comment out the "async stuff" and remove async from the function declaration, it builds fine.
Is this a compiler error or am I missing something?
My educational app is structured around courses. Users can subscribe for "unlimited" courses or a "single course".
The question is how best to implement the "single course" subscription -- so that the app knows which course is subscribed and also so that the user can change courses?
One approach would be to define a separate subscription IAP for each course. Then it's trivial for the app to know which course, and the user could upgrade/downgrade/crossgrade to a different course using the Manage Subscriptions UI.
The problem is that we already have a dozen courses and we're headed for dozens more. I'm afraid the Manage Subscriptions UI wasn't intended to handle a case where there are hundreds of subscription options.
The other approach would be to have only one "single course" subscription; then I'd need to manage the course info myself and there'd be no good crossgrade path for the user.
Am I thinking about this correctly? Are there other options besides the two mentioned?
Post not yet marked as solved
I have an app that has been in production for years. It has a single in-app purchase that was approved years ago.
Recently I submitted a routine update for review and my binary was rejected. The reason:
Guideline 2.1 - Performance - App Completeness
We are unable to complete the review of your app because one or more of your in-app purchase products have not been submitted for review.
I replied (with screenshots) that the IAP is already approved and they said, "no, that's a different IAP." But the app has only one IAP.
I tried to submit a new binary and re-submit the IAP for review, but it seems that you have to remove it from production in order to do that. This will break the app.
I have appealed the rejection and the appeal reviewer agreed with the original review.
The App Review Board evaluated your app and determined that the original rejection feedback is valid. Your app does not comply with App Store Review Guideline 2.1.
Here's another developer with the same experience: https://developer.apple.com/forums/thread/102738
Any way out of this catch-22?
Post not yet marked as solved
In XCode 6.4, when I try to run the simulator of iPhone 4S (any of the iOS 8.x versions), I receive this error message:Unable to boot device because it cannot be located on disk.The simulator comes up, but (usually) the app doesn't run (occasionally, it does). XCode hangs.I was able to get it to run by removing all derived data and cleaning out the CoreSimulator/Devices dir and then rebooting my machine. But now it's doing it again.The other devices run fine on the simulator.
Post not yet marked as solved
In XCode 9.2, I open the Accessibility Inspector and want to change font size to test dynamic type. I click the Settings tab, but there's no font size slider.
My app uses a 3rd party lib (AMPopTip) which conditionally includes some SwiftUI code. The app builds and runs fine in Xcode 13, but the archive build fails with errors such as:
Cannot find type 'View' in scope
Cannot find 'UIHostingController' in scope
These errors only show up for armv7 architecture. At first, I thought I should not be building for armv7, but in fact the same archive build works fine in Xcode 12.5.
Post not yet marked as solved
I have been receiving this error message since April 5:Can't Generate Promo CodeWe're having trouble generating the codes. Please contact App Store Developer Support for assistance.I have plenty of promo codes remaining.Also, when I click through to the contact page, I get a useless series of menus that let me specify my problem and no place to actually send a message. It just has two buttons ("Start over" and "Done").UPDATE: After six (6) days of downtime, this appears to be fixed.
Post not yet marked as solved
I have a sample project with a single label constrained to the root view on top, leading, trailing sides. The label has numberOfLines=0 and multiple lines of text. In IB, the root view has Follow readable width checked, and for good measure so does the label.
But when I run it on an iPad simulator, the width of the text is full screen. What's missing?
Post not yet marked as solved
My app was rejected bc the reviewer had a problem completing an in-app purchase. That code is thoroughly tested; I can only guess they ran into the usual sandbox App Store flakiness.
After the rejection, all my IAP's were marked "Developer action needed". Following a suggestion on the forums, I made one trivial edit and they all changed to "waiting for review". This makes no sense as they haven't actually changed.
But now I'm unable to re-submit my app. My launch is time-sensitive and I'm afraid I've fallen into limbo.
Can anyone explain what's going on?
Post not yet marked as solved
I am super excited about the new compositional layout apis in collection view, however it's not clear how to handle an important use case in my app: hierarchical data.Here's a made-up example of a hierarchical data model:I'm displaying a list of fruit. For each type of fruit (apple, banana, ...), I have: + a variable number of varieties + a variable number of favorite dishesIn my list, I want each variety and each dish to have its own thumbnail image.From a layout perspective, compositional layout is perfect for this; but from a data model perspective ...Each fruit could be a separate section; but within each section you have to flatten your data, indexing varieties and dishes in a single collection. That feels ugly and error-prone.Now imagine we want a single list that covers fruit, vegetables, and herbs. If we make each main category a section, then within each category we have to flatten all our names, varieties and dishes into one big list. That feels really ugly and error-prone.Alternatively, we could define a separate section for every distinct data set:1. Apple2. Apple varieties3. Apple dishes4. Banana5. Banana varieties6. Banana dishes...But this also loses the nested quality of the data. Eg., we couldn't have separate sections for our categories.I'm wondering if I'm thinking about this correctly or perhaps missing something?
Post not yet marked as solved
I am finding it very difficult to get developer information about the VPP for education. I see that on my app pricing page I can opt into "Apple School Manager", but that seems to be different than basic VPP.Where can I find developer docs (not user docs) for these programs?
Post not yet marked as solved
It is confusing that the receipt's ASN.1 "App Version" field contains CFBundleVersion, aka "build version". Apple's receipt validation guide states that this value should be verified. This raises two questions:First, why verify App Version? If user purchased IAP from a different app version, in most cases won't we expect that IAP to still be valid?Second, isn't "build version", which is not guaranteed to be unique across app versions, the wrong value to be verifying?
Post not yet marked as solved
I'm seeing a sporadic crash due to misconfigured auto layout constraints on the nav bar. The backtrace doesn't refer back to my code and I'm trying to figure out if this is a UIKit bug.This app uses the nav bar in two ways: 1. It places a search bar there on some table views. 2. It places a right bar button there on some view controllers.In neither case does it add any auto layout constraints.In the entire app, there are only a handful of height constraints, and they don't touch the nav bar.Am I correct in concluding this is a UIKit bug? I am very hesitant to assume so, but if not, am sure stumped about where in my code this bug could originate.Fyi, this is a symbolicated crash received via HockeyApp. I have never seen this on my own device or simulator.Exception Type: SIGTRAP
Exception Codes: #0 at 0x18434507c
Crashed Thread: 4
Application Specific Information:
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to activate constraint with anchors <nslayoutdimension:0x1106a48c0 "_uibuttonbarbutton:0x1106a36c0.height"=""> and <nslayoutdimension:0x1c6c7d7c0 "uilayoutguide:0x1c43ba320'uiviewlayoutmarginsguide'.height"=""> because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal.'
Last Exception Backtrace:
0 CoreFoundation 0x00000001848bdd04 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x0000000183b0c528 objc_exception_throw + 52
2 CoreFoundation 0x00000001848bdc4c +[NSException raise:format:] + 112
3 Foundation 0x00000001853ccd18 -[NSLayoutConstraint _setActive:mutuallyExclusiveConstraints:] + 300
4 Foundation 0x00000001853cd004 __55+[NSLayoutConstraint _addOrRemoveConstraints:activate:]_block_invoke + 72
5 Foundation 0x00000001851ef59c -[NSISEngine withBehaviors:performModifications:] + 164
6 Foundation 0x00000001853cced4 +[NSLayoutConstraint _addOrRemoveConstraints:activate:] + 328
7 UIKit 0x000000018e6d15f8 -[_UIButtonBar _layoutBar] + 3332
8 UIKit 0x000000018e6d34ec -[_UIButtonBarStackView updateConstraints] + 48
9 UIKit 0x000000018e7f2bb0 -[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:] + 184
10 UIKit 0x000000018e7f3078 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 1004
11 UIKit 0x000000018e7f2f50 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 708
12 Foundation 0x00000001851ef59c -[NSISEngine withBehaviors:performModifications:] + 164
13 UIKit 0x000000018e7f32c4 -[UIView(AdditionalLayoutSupport) _recursiveUpdateConstraintsIfNeededCollectingViews:forSecondPass:] + 120
14 UIKit 0x000000018e7f2f50 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 708
15 Foundation 0x00000001851ef59c -[NSISEngine withBehaviors:performModifications:] + 164
16 UIKit 0x000000018e7f3810 __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 88
17 UIKit 0x000000018e7f23fc -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 112
18 UIKit 0x000000018e7f342c -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 164
19 UIKit 0x000000018e7efc2c -[UIView(AdditionalLayoutSupport) _systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:hasIntentionallyCollapsedHeight:] + 336
20 UIKit 0x000000018e7ef990 -[UIView(UIConstraintBasedLayout) systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:] + 256
21 UIKit 0x000000018e089c00 -[UINavigationController _navigationBarSizeForViewController:proposedHeight:verticalFittingPriority:allowRubberBandStretch:] + 364
22 UIKit 0x000000018e088b6c -[UINavigationController _calculateTopViewFramesForLayoutWithViewController:contentScrollView:navBarFrame:topPaletteFrame:topLayoutType:] + 868
23 UIKit 0x000000018e087f5c -[UINavigationController _updateTopViewFramesToMatchScrollOffsetInViewController:contentScrollView:topLayoutType:] + 116
24 UIKit 0x000000018e08ad84 -[UINavigationController _observeScrollViewDidScroll:topLayoutType:] + 244
25 UIKit 0x000000018dff67bc __54-[UIScrollView(UIScrollViewInternal) _notifyDidScroll]_block_invoke + 76
26 UIKit 0x000000018dff6c98 -[UIScrollView(UIScrollViewInternal) _enumerateAllScrollObserversWithBlock:] + 232
27 UIKit 0x000000018dff6754 -[UIScrollView(UIScrollViewInternal) _notifyDidScroll] + 152
28 UIKit 0x000000018dd13084 -[UIScrollView setContentOffset:] + 400
29 UIKit 0x000000018dff8ba0 _UIScrollViewAdjustForOverlayInsetsChangeIfNecessary + 360
30 UIKit 0x000000018dff8e10 -[UIScrollView(UIScrollViewInternal) setSafeAreaInsets:] + 272
31 UIKit 0x000000018dfc7cb8 -[UIView _eagerlyUpdateSafeAreaInsetsToDescendant:] + 368
32 UIKit 0x000000018e05cc68 -[UIViewController _updateViewSafeAreaInsetsAndEagerlyUpdateContentScrollView:] + 464
33 UIKit 0x000000018e05d234 -[UIViewController _setContentOverlayInsets:andLeftMargin:rightMargin:] + 776
34 UIKit 0x000000018e05ea1c __121-[UIViewController __updateContentOverlayInsetsWithOurRect:inBoundsOfAncestorViewController:viaImmediateChildOfAncestor:]_block_invoke + 384
35 UIKit 0x000000018e05e868 -[UIViewController __updateContentOverlayInsetsWithOurRect:inBoundsOfAncestorViewController:viaImmediateChildOfAncestor:] + 2636
36 UIKit 0x000000018e05dcc4 -[UIViewController _updateContentOverlayInsetsFromParentIfNecessary] + 584
37 UIKit 0x000000018e05d47c -[UIViewController _updateContentOverlayInsetsForSelfAndChildren] + 104
38 UIKit 0x000000018dd9c8ec -[UINavigationController _layoutViewController:] + 136
39 UIKit 0x000000018dd9a440 -[UINavigationController _layoutTopViewController] + 256
40 UIKit 0x000000018dd9b50c -[UINavigationController _startDeferredTransitionIfNeeded:] + 1288
41 UIKit 0x000000018dd9af0c -[UINavigationController __viewWillLayoutSubviews] + 160
42 UIKit 0x000000018dd9ae0c -[UILayoutContainerView layoutSubviews] + 184
43 UIKit 0x000000018dcf22f8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1272
44 QuartzCore 0x00000001888abec8 -[CALayer layoutSublayers] + 180
45 QuartzCore 0x00000001888affa8 CA::Layer::layout_if_needed(CA::Transaction*) + 328
46 QuartzCore 0x000000018881ea98 CA::Context::commit_transaction(CA::Transaction*) + 332
47 QuartzCore 0x0000000188844eb4 CA::Transaction::commit() + 536
48 QuartzCore 0x000000018884559c CA::Transaction::release_thread(void*) + 240
49 libsystem_pthread.dylib 0x00000001844e7680 _pthread_tsd_cleanup + 568
50 libsystem_pthread.dylib 0x00000001844e73d0 _pthread_exit + 84
51 libsystem_pthread.dylib 0x00000001844e7168 _pthread_wqthread + 1336
52 libsystem_pthread.dylib 0x00000001844e6c20 start_wqthread + 0
Post not yet marked as solved
I have an attributed string in a UITextView and I'm trying to use a paragraph style to set line spacing: let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineSpacing = 11.0 let attributes: [NSAttributedStringKey: Any] = [ .font: myFont .paragraphStyle: paragraphStyle ] let str = NSMutableAttributedString(string: string as String, attributes: attributes)I find that lineSpacing has no effect unless I also set paragraphStyle.maximumLineHeight. paragraphStyle.maximumLineHeight = 12.0I guess that's ok, but the problem is handling dynamic type. The fixed value for maximumLineHeight doesn't work when type size changes. In iOS 11, I can use UIFontMetrics to scale these values, but what do I do pre-iOS 11?Am I missing something? Is there a more straightforward way to control line spacing?