Post marked as solved
58
Views
In a MacOS Objective C project with Xcode 12.5.1, I tried to use max(). Received an error, and pressed "Fix" and I put #include math.h in a header. Subsequently, when I ran the project, I got two errors in a row saying "The document math.h cannot be saved...You don't have permission, etc." and when I press OK, I get the same message again. The instructions are open the file in the finder to change permissions. I don't have that file anywhere on my computer. So I deleted the include, removed the max() function and I still get the errors, although the project builds without other errors and the test app works.
I've searched the project for any reference to math.h and found none.
Now when I try to quit Xcode, I get an error that I don't have permission to write to the folder with math.h and choice is to Duplicate (what???) or OK. I choose OK and I cannot quit Xcode.
So, how do I remove whatever this is with math.h to get back before I ever tried using max()???
Post not yet marked as solved
1.9k
Views
In order to correctly arrange horizontal pickers representing Month, Day, Year in a Watch app, I'd like to get the order based on a user's language and region. Ideally, a return value from a function or property as simple as MDY vs. DMY vs. YMD.How can I get this info from a locale (or ???)?
Post not yet marked as solved
235
Views
Updating an older iOS/WatchOS app, received this warning after a symbolic breakpoint, with Xcode 12.4. I thought I understood the message (below) but when I checked (ObjC, storyboard), there's the view - safety area - and my TableViewController with the TVC constraints all limited to the safety area.
I have no clue what how to eliminate this, OR if I even have to. If I disable the breakpoint, the app works perfectly on my iPhone X 13.4 and the simulators with no other warnings or messages.
Does this message have to be addressed, and if it does, how do I inspect and fix it?
2021-02-17 10:46:06.461895-0600 OBWheelPro7[34829:9634118] [TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: UITableView: 0x10301e200; frame = (0 0; 320 519); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = NSArray: 0x282650180; layer = CALayer: 0x282874160; contentOffset: {0, 0}; contentSize: {320, 176}; adjustedContentInset: {0, 0, 0, 0}; dataSource: xxCalculatorViewController: 0x10301d600
#0 0x000000019003a6b4 in UITableViewAlertForLayoutOutsideViewHierarchy ()
#1 0x00000001900397f4 in -[UITableView _updateVisibleCellsNow:] ()
#2 0x000000019004c980 in -[UITableView _cellForRowAtIndexPath:usingPresentationValues:] ()
#3 0x000000019004c864 in -[UITableView cellForRowAtIndexPath:] ()
#4 0x000000018fde35d8 in __61-[UIPickerTableView selectRow:animated:notify:updateChecked:]_block_invoke.216 ()
#5 0x0000000190355704 in +[UIView(Animation) performWithoutAnimation:] ()
#6 0x000000018fde31e0 in -[UIPickerTableView selectRow:animated:notify:updateChecked:] ()
#7 0x000000018fdea748 in -[UIPickerView _selectRow:inComponent:animated:notify:] ()
#8 0x000000018fddd710 in -[_UIDatePickerView _selectRow:inComponent:animated:notify:] ()
#9 0x000000018fdd3b38 in -[_UIDatePickerMode loadDate:animated:] ()
#10 0x000000018fdd7c74 in -[_UIDatePickerMode_DateAndTime loadDate:animated:] ()
#11 0x000000018fddd6b8 in -[_UIDatePickerView _loadDateAnimated:] ()
#12 0x000000018fddcfa4 in -[_UIDatePickerView didChangeDateFrom:animated:] ()
#13 0x000000018fddcc48 in -[_UIDatePickerView setData:] ()
#14 0x000000018fdcb584 in -[UIDatePicker _installPickerView:updatingSize:] ()
#15 0x000000018fdcbf7c in -[UIDatePicker initWithCoder:] ()
#16 0x00000001961c6edc in UINibDecoderDecodeObjectForValue ()
#17 0x0000000196153854 in -[UINibDecoder decodeObjectForKey:] ()
#18 0x000000018fa9d570 in -[UIRuntimeConnection initWithCoder:] ()
#19 0x00000001961c6edc in UINibDecoderDecodeObjectForValue ()
#20 0x00000001961c70f4 in UINibDecoderDecodeObjectForValue ()
#21 0x0000000196153854 in -[UINibDecoder decodeObjectForKey:] ()
#22 0x000000018fa984fc in -[NSCoder(UIIBDependencyInjectionInternal) _decodeObjectsWithSourceSegueTemplate:creator:sender:forKey:] ()
#23 0x000000018fa9aed4 in -[UINib instantiateWithOwner:options:] ()
#24 0x000000018f796d88 in -[UIViewController loadView] ()
#25 0x000000018f797114 in -[UIViewController loadViewIfRequired] ()
#26 0x000000018f7977e8 in -[UIViewController view] ()
#27 0x000000018f6b339c in -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] ()
#28 0x000000018f6b2734 in -[UITabBarController transitionFromViewController:toViewController:] ()
#29 0x000000018f6aeec0 in -[UITabBarController _setSelectedViewController:] ()
#30 0x000000018f6aecd8 in -[UITabBarController setSelectedViewController:] ()
#31 0x0000000190355704 in +[UIView(Animation) performWithoutAnimation:] ()
#32 0x000000018f6a9be0 in -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] ()
#33 0x000000018f6aab90 in -[UITabBarController viewWillAppear:] ()
Post not yet marked as solved
121
Views
My 2015 universal app needing an update apparently needs a Launch Screen storyboard. The iPhone app (for smaller phones in portrait and landscape) is basically a tab bar controller connected to several navigable table view controllers displaying first a topics table page and then details. For larger iPhones and iPads, this is all done programmatically in my code and becomes a split view with a column for topics and a larger area for details. The current app uses dozens of screen shots for each device and orientation.
With Xcode 12, I'm at a loss of how to create a single launch screen that will display the tab bar controller and an empty table (which was easy), yet magically move the tab bar controller to the left and the details on the larger area on the right for a split view.
Is there any documentation/videos/tutorials of how to manage this? If it was just iPhones and iPads I could make two launch storyboards but I don't know how to include large iPhones.
Post not yet marked as solved
240
Views
I have read the disconnected documentation for adding a "simple" complication that ONLY launches my app using the asset images I've created in various sizes for various families along with the ComplicationController code, but the complications never appear (with no errors).
I would like to support Watch Series 1 with OS 4.3 on up. There never seems to be one place where this simple, default function is documented.
What are the steps and code required to just launch a Watch app from a complication?
Post not yet marked as solved
126
Views
When I run my Watch app in the Xcode 12.2, MacOS 11.0.1 Simulator (any size watch) for an update the text in my three WKInterfacePickers are truncated with ellipsis, e.g. MONTHS Jul, A..., Sep DAYS 14,15,16, YEARS 20..., 20..., 20...
I keep the Width "Relative to Container" specifying a percentage for each picker adding up to 1. The Height of the Group container is constant.
With the same settings on my (only) hardware 1st Gen Watch watchOS 4.3.2, the titles/text are fine and complete. The ellipses are less frequent with the 44mm face though.
It doesn't seem the titles/text adapt to their containers. Any ideas?
Post not yet marked as solved
129
Views
I'm an Objective C relic (don't do Swift) with an iPhone app with a Watch app that I haven't had to touch for 2 years (because it just works) and has worked with WatchOSs 1-6 but now is broken because I used one Force Touch menu item in three paged views each with three pickers (just a spinner on opening).
Basically, the app is a calculator using dates and the menu item simply lets the Watch user set the date to Today with one tap instead of fiddling with three pickers.
I've watched the 2020 WWDC video "What's New in watchOS Design". It looks like the best fit would be a toolbar button on top but that is only available in OS 7. Many users can't have OS 7 on a 1st Gen Watch. I thought I could create a home-brew replica but found there is not a scroll view in watchOS before 7 to even place a button. The next best thing would be something like a More button but I can't figure out how to add/overlay a button (leading to a modal) in a lower corner (no constraints or auto layout in watchOS) without running into trouble with curved screens and different sized faces.
So, I would be interested in any suggestions and help on how to resolve this for all watchOSs, or I guess I'll just remove this helpful functionality (which many probably do not even know is there because it's hidden).
Post not yet marked as solved
155
Views
Is it still possible to create a watch app for 1st Generation Apple Watch running 4.3.2 and compatible with 7? How?
Post not yet marked as solved
473
Views
I have had two user contacts in the last week where they easily install my Universal app on another iPhone, restore their previous IAP upgrade purchase (added functionality - interconnectivity via BTLE between iOS devices), BUT when they install to a second device, exclusively an iPad (both iPad Airs - so far), and try to restore the IAP purchase, my app is not able to connect to the App Store for the IAP upgrade. My app displays a message when there is no Internet access or no connection to the App Store with the same error message.My app has not been updated since 2017 with a dozen or so IAP upgrades as one of its main features. I have not been able to reproduce the error on my iPhone X and iPad Pro (on iOS 12.4.1 as is with these users). And no Crashes in the last two weeks with Xcode Organizer. In fact, the connection and upgrade on my devices and network is instantaneous. I have had users not be able to connect to the App Store a couple times a year that is solved by just trying again later.In both cases, with the latest iOS, they have 1) demonstrable Internet connections, 2) tried later several times over days, 3) tried deleting the app to their iPads and reinstalling it, 4) powered down and powered up the iPad.I fear these two incidents may be the tip of the iceberg for some bizarre reason, but as I cannot reproduce this, I'm clueless.Does anyone know what could be causing this, or how I can diagnose these errors?
Post not yet marked as solved
1.9k
Views
I have an app with an action extension that takes a photo (the app only) or grabs a photo from a 3rd-party app or within the app itself, e.g. Photos, adds an imprint, e.g. date, and then adds a new photo to an album, Camera Roll. The app itself has no issue doing that for any photo in any app (lots of memory). But the extension crashes when the original photo is over ~8mb with some hard memory limit (120mb). But when I watch the memory use, it stays around 20mb, and when I initiate the stamped overlay, it briefly goes to 80mb, and then back down to 20mb and then crashes.The error is EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=120 MB, unused=0x0). Finally, I found that problem resides in a method where I add the imprint by drawing the original image in a graphic context using drawInRect: and then drawing the overlay into the same context and converting it to a UIImage and returning that to the caller. The app crashes at drawInRect: with vImage`_ERROR_Buffer_Write__Too_Small_For_Arguments_To_vImage__CheckBacktrace:With larger megapixel phones, this has caused me to remove my app from the App Store, and It sure doesn't seem like I've broken any programming rules.Does anyone know how to fix this kind of issue/crash?
Post not yet marked as solved
1.1k
Views
I have several initially hidden UIPickers in a vertical stack view, where the user chooses one via a segmented controller or a table view elsewhere, and it is unhidden (code below). Visually it works fine - the correct picker appears. But I want to add a subview (a units label) to several of the pickerviews. When I immediately look at the frame of newView in the code below, the frame origin has values as well as the width, but the height is always zero as if the view is still totally collapsed in the stack view. What I need is the height of the picker view to calculate where to put the label subview before it appears.But paradoxically (to me), the next time around when another picker view is chosen (without the segmented controller around so the picker will be bigger because of AutoLayout constraints), the newView frame for the previous picker appears WITH A HEIGHT and does not reflect the size of the just unhidden picker.Does anyone know how to find the height of the expanded unhidden picker view before or immediately after it appears?- (void)showPickerInStackView:(NSUInteger)newPickerIndex {
// hide them all first
for (int i = 0; i < self.pickerStackView.arrangedSubviews.count; i++) {
self.pickerStackView.arrangedSubviews[i].hidden = YES;
}
UIView *newView = self.pickerStackView.arrangedSubviews[newPickerIndex];
newView.hidden = NO;
}
Post not yet marked as solved
546
Views
I have UIPickerView within a vertical StackView, and with various settings for distribution, sometimes the picker looks instrinsic size of 216 high and other times it is ~360 points. I want to overlay a label view (for units) and I want to to center vertically the label. I tried trying to measure the picker height in viewDidLayoutSubviews but the value for the picker's frame isn't close to what I see.So, the question is, at what point and in what part of the view cycle can I find out the visible height of a view, e.g. picker?
Post not yet marked as solved
405
Views
Just curious about an app from a 3D camera maker that is definitely non-native (and a shortcut to compatibility with Windows apps???) and reminds me of something in the past like X-Windows with a crude file browser that displays long pathnames from the root. The entire app is within one "Mac" window and the app's actual menu is inside that window (link to screenshot below)What do you think they are using?https://www.icloud.com/iclouddrive/0hrj-_4J0eIeJ5FqtGk8FAI5A#vuzeapp.png
Post not yet marked as solved
1.7k
Views
Just updated to 10.0, opened a 9.4 project and in IB, no graphics (image assets) or colors appear just blue outlines of all views on a white background. Also shows "An internal error occurred. Editing functionality may be limited."What next?
Post not yet marked as solved
456
Views
For an iOS 8 iPhone/Portrait-only app with an app extension (that's supposed to ignore the base app's restrictions and become Universal), I'm having trouble dealing with the extension use in iPads in particular. What appears is a form sheet within a full-screen (grayed out) modal presentation with my view controller content within whether Portrait or Landscape. Where exactly the dimensions of the form sheet are specified is a mystery to me (not in IB) as I use AutoLayout and all sides are supposed to hug all borders, but instead I get something the size of an iPhone for the form sheet in the middle of the screen.I've "hacked" my way to specify the size of the iPhone-sized view in loadView of the controller, and determine that it is within an iPad, and change the view controller's preferredContentSize to an arbitrary value.So, what is the correct/efficient way to identify the content size in the system modal presentation view controller and then set the size of the content in the modal presentation as it appears AutoLayout in IBseems to have no effect?