Post

Replies

Boosts

Views

Activity

UITableView (UITableViewStyleGrouped) missing nice top padding in popovers
Usually, when I display a UITableView (UITableViewStyleGrouped) somewhere, there's a nice strip of gray padding at the top, above the first cell in the first section. But, when displayed in a popover on an iPad, the same UITableView appears with the first cell aligned to the top edge, i.e., you can't see any gray padding. If you drag the UITableView down with your finger, you can see that the padding exists, but as soon as you let go, the UITableView snaps back so that the top cell is aligned with the top edge. Curiously, if the top section has a header string, the UITableView behaves as you would expect. Any thoughts are appreciated!
1
1
1.2k
Jul ’22
why is autoreleasepool releasing objects that were retained?!
Hello! I'm using Core ML to do some machine learning predictions. It seems that I have to put the call to "predictionWithFeatures" in an autoreleasepool block, otherwise it will leak memory like crazy. (This is in a project with ARC turned off.) I need to be able to use the results of the prediction outside of the function that does the predictions. So, no problem, I just 'retain' the object that gets returned, right? Except that the autoreleasepool seems to free the object even though its retain count is 3. (Aside: why is it 3?) If anybody can tell me why the autoreleasepool block is freeing objects that have been retained, I would greatly appreciate it. Thank you! Pseudocode below... myCoreMLModelOutput *outputGlobal = NULL; void DoPredictions() { if (outputGlobal != NULL) { [outputGlobal release]; outputGlobal = NULL; } ... @autoreleasepool { // necessary to prevent predictionFromFeatures from leaking memory outputGlobal = [myCoreMLModel predictionFromFeatures ...]; [outputGlobal retain]; // need to be able to access this later printf("retain count: %d\n", (int)[outputGlobal retainCount]); // why is this 3 and not 1 or 2? } DoSomethingWithOutputGlobal(); // crashes ... why was outputGlobal released?! }
5
0
1.5k
Sep ’22
Why am I not getting deprecation warnings for UIAlertView?
I have an old iOS project that I'm updating.It uses UIAlertView a lot, which was deprecated in iOS 9, but I'm not seeing any deprecation warnings when I build the app.(I've seen warnings when updating other apps.)This is concerning me. If I'm not seeing these warnings, what other warnings am I missing?I've checked the build settings for the app and under "Apple LLVM 8.1 - Warnings - All languages" the setting for "Deprecated Functions" is set to "Yes" as it seems like it should be.I've grepped my entire project for the words "deprecate" and "warning" and "pragma" and nothing's showing up that would suppress these warnings.Does anybody have any advice for other things to check? Thanks in advance! (BTW, I'm using XCode 8.3.3 8E3004b.)
3
0
3.5k
Jul ’23
Deleting an ubiquity container = giant mess?
TL;DR: Does Apple keep a list of ubiquity containers that a user has deleted, and prevent apps from creating the same ubiquity containers again? If so, where is this list, and how can I reset it? Long version: I'm developing an app that relies on having an ubiquity container (iCloud Drive folder). This was working fine until I decided to rename the folder. I deleted the existing folder with the old name, changed the value of "NSUbiquitousContainerName," and expected my app's code to create the new folder with the new name, as it had done originally. But the result has been a disaster. Now, in the simulator, all of my code is running without errors. The app thinks the iCloud Drive folder exists and can read and write files to it, but the folder only seems to exist in the simulator and is not visible via any iCloud Drive UI. When I run the exact same code on my iPhone, the code fails with the error 'You don’t have permission to save the file “Documents” in the folder “[whatever]”.' I have tried changing my app's bundle identifier and everything works swimmingly: the iCloud Drive folder is created instantly and is visible everywhere. So something is preventing things from working with the original bundle identifier and I need to figure out what it is and how to fix it. Does anybody have any ideas? Thanks in advance.
0
1
591
Jul ’24
XCode not making bridging header file?
Hi, I'm trying to add Swift code to my Obj-C project. I've gone through all the tutorials and troubleshooting advice I can find online, no dice. I would appreciate any help, thank you so much in advance. I add a new swift file to my Obj-C project XCode offers to create a bridging header file for me, yes please New .swift file and .h file are added to my project no problem Header file shows up in build settings no problem I add a new class to my new swift file ("@objc class HelloPrinter: NSObject") When I build the app, nothing is generated in the bridging header file and the class is obviously inaccessible to my obj-c code Is this supposed to work? My understanding is that it's supposed to work. Somewhat concerning is the text that XCode puts in the bridging header file when it's created: "Use this file to import your target's public headers that you would like to expose to Swift." I don't want to use this bridging header file for anything. I want XCode to GENERATE STUFF in the bridging file. I also don't want to expose anything to Swift. I want the opposite to happen. So I don't get this text at all. Thanks in advance again.
2
0
92
Apr ’25
Am I supposed to be able to do iOS development with 16GB of RAM?
I have a small, simple iOS project that doesn't use a lot of memory or libraries or anything. If I open my iOS project in XCode and run it on the iPhone 17 simulator, my memory consumption (as seen in Activity Monitor) goes into the yellow zone. Granted, I have some other apps open (Safari, Mail, Messages, the usual stuff that people run) but nothing especially demanding. Without XCode and the Simulator running, my memory consumption is only around 25% on the Activity Monitor graph. Is this expected behavior with Tahoe and iOS 26? I was able to work on my project without running out of RAM on this same computer for the past 4 years no problem. Now it seems I have a problem.
0
0
140
3w
UIToolbar + liquid glass = autolayout warnings?
I have an app where I create UIToolbars and add them to UIViews programatically. I've never used autolayout for anything, I've never assigned any constraints to anything, etc. This worked fine pre-iOS 26. Now I'm trying to build for iOS 26 (liquid glass) and my toolbars are spamming my debug pane with hundreds of lines of autolayout warnings. Here are some key phrases from the warnings: Unable to simultaneously satisfy constraints. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) Does anybody know what happened and how I can get it to stop? The way things are, I can't use the debug pane for anything because of this spam.
2
0
195
2w