Post

Replies

Boosts

Views

Activity

Reply to macOS ADCertificate Managed Payload – Auto-Renewal Not Working
Experiencing issues with ADCertificate auto-renewal on macOS devices enrolled via MDM, especially with Microsoft AD CS, can be challenging due to the interplay between different systems. While Apple's documentation and community forums may not always cover every specific scenario, here are some insights, potential causes, and troubleshooting steps based on common issues and best practices: Known Issues and Considerations MDM and Certificate Renewal Limitations: macOS's support for auto-renewing certificates via MDM has certain limitations and might not be as robust as on iOS. Microsoft AD CS integration can add complexity, particularly if certificate templates or renewal settings are not aligned. Certificate Template Configuration: Ensure that the AD CS certificate template used supports renewal and is configured correctly. The template should have settings for auto-enrollment and renewal, typically under the "Extensions" tab in the template properties. Check the "Renewal Policy" settings to ensure they align with your desired renewal interval and conditions. Kerberos Authentication: Ensure that the MDM server and client machines have proper Kerberos authentication configured. Certificate renewal often relies on Kerberos tickets, and misconfigurations can lead to renewal failures. Time Synchronization: Accurate time synchronization is crucial for certificate operations. Ensure that both the AD domain controllers and macOS devices are synchronized with a reliable time server. Event Logs: Review event logs on both the macOS devices and the AD CS servers for clues. On macOS, check the System.log and Security.log for certificate-related errors. On the AD CS server, look in the Application and System logs for certificate enrollment and renewal events. Troubleshooting Steps Verify Payload Configuration: Double-check your MDM payload configuration to ensure all fields are correctly set, especially EnableAutoRenewal and CertTemplate. Ensure that CertificateRenewalTimeInterval provides enough time for renewal before the certificate expires. Test Manual Renewal: Temporarily disable auto-renewal and manually enroll a certificate to verify that the process works as expected. This can help isolate whether the issue lies with auto-renewal or the initial enrollment. Check Certificate Chain: Ensure that the AD CS server's certificate chain is complete and properly trusted on the macOS devices. Intermediate certificates must be installed and trusted for chain validation to succeed. Update MDM and macOS: Ensure that both your MDM solution and the macOS devices are running the latest compatible versions. Updates may include bug fixes or improvements related to certificate management. Consult Microsoft and Apple Support: Given the complexity of the issue, consider reaching out to both Microsoft support (for AD CS) and Apple support (for MDM and macOS). They may have specific guidance or patches related to your configuration. Community and Forums: Explore community forums such as Apple Developer Forums, Microsoft Tech Community, and MDM-specific communities. Other users may have encountered similar issues and found solutions. Alternative Approaches If auto-renewal continues to be problematic, consider alternative approaches such as: Script-Based Renewal: Implement a script to manually renew the certificate before it expires. This can be scheduled using launchd or cron on macOS. Third-Party MDM Solutions: Investigate third-party MDM solutions that may offer more robust certificate management features and better compatibility with Microsoft AD CS. By systematically addressing these areas, you can identify and resolve the factors preventing ADCertificate auto-renewal on your macOS devices. If the issue persists, engaging with support teams will be crucial to finding a tailored solution.
Topic: Community SubTopic: Apple Developers Tags:
Feb ’26
Reply to Calling a Objc method directly from C
Calling Objective-C directly from C is certainly possible and can simplify your codebase by eliminating intermediate layers. Additionally, using Grand Central Dispatch (GCD) to manage thread safety and dispatch tasks to Objective-C contexts is a sound approach. Below, I'll outline how you can achieve this, maintaining thread safety and leveraging GCD effectively. Direct Objective-C Function Call from C Assuming you have an Objective-C method you want to call directly from C, you can use the Objective-C runtime functions to achieve this. Here's a step-by-step guide: Objective-C Method Declaration First, ensure your Objective-C method is declared properly. For example: @interface Renderer : NSObject (void)mtlEnd; @end C Function to Call Objective-C Method You can define a C function that uses the Objective-C runtime to call the mtlEnd method: #include <objc/runtime.h> void mtlEnd(MTRenderContext mt_ctx) { // Retrieve the class of the render context Class rendererClass = mt_ctx->mt_render_funcs.mtlObj.isa; // Get the selector for the mtlEnd method SEL selector = @selector(mtlEnd); // Find the implementation of the method IMP implementation = class_getInstanceMethod(rendererClass, selector); // Call the method using the IMP void (*func)(id, SEL) = (void (*)(id, SEL))implementation; func(mt_ctx->mt_render_funcs.mtlObj, selector); } Thread Safety with GCD To ensure thread safety when calling Objective-C code from C, you can use GCD to dispatch the call to a specific thread or queue. Here's how you can incorporate a lock using dispatch_queue_t: #include <dispatch/dispatch.h> // Create a serial dispatch queue for thread safety static dispatch_queue_t renderQueue = dispatch_queue_create("com.yourapp.renderQueue", DISPATCH_QUEUE_SERIAL); void mtlEnd(MTRenderContext mt_ctx) { dispatch_async(renderQueue, ^{ // Retrieve the class of the render context Class rendererClass = mt_ctx->mt_render_funcs.mtlObj.isa; // Get the selector for the mtlEnd method SEL selector = @selector(mtlEnd); // Find the implementation of the method IMP implementation = class_getInstanceMethod(rendererClass, selector); // Call the method using the IMP void (*func)(id, SEL) = (void (*)(id, SEL))implementation; func(mt_ctx->mt_render_funcs.mtlObj, selector); }); } Explanation Objective-C Runtime: Functions like class_getInstanceMethod and IMP are used to dynamically invoke Objective-C methods from C. GCD for Thread Safety: By dispatching the method call to a serial queue (renderQueue), you ensure that only one thread executes the Objective-C code at a time, preventing race conditions. Serial Queue: DISPATCH_QUEUE_SERIAL ensures FIFO execution, maintaining the order of operations and protecting shared resources. Integration Ensure your C and Objective-C files are properly linked in your Xcode project. Compile with the necessary flags to support Objective-C runtime functions (usually -framework Foundation). This approach allows you to maintain a C foundation for your application while efficiently leveraging Objective-C's capabilities, particularly for tasks like rendering with Metal, and ensures thread safety using GCD.
Topic: Programming Languages SubTopic: General Tags:
Feb ’26
Reply to iOS26.2 webview use websocket cause net lose
Encountering a network issue in WKWebView on iPhone 15 models with iOS 16.2, particularly under conditions of frequent large WebSocket data packets, is indeed unusual and concerning. This issue seems to affect the entire network stack for the app, which points to a deeper problem possibly related to resource exhaustion or a bug in handling network resources. Here are some steps and considerations to help diagnose and potentially resolve this issue: Diagnostic Steps Monitor Resource Usage: Use Instruments on macOS to monitor the app’s resource usage, especially focusing on CPU, memory, and network activity when the issue occurs. Look for spikes or anomalies that could indicate resource exhaustion. Check for Leaks: Ensure there are no memory leaks in your WebView handling code. Leaks can gradually consume resources, leading to instability. Instruments can also help identify memory leaks. Network Activity Logging: Log network activity to understand what happens when connections time out. Use URLSession’s delegate methods or third-party libraries to capture detailed logs of network requests and responses. WebSocket Message Handling: Examine how your app processes incoming WebSocket messages. Large messages might not be handled efficiently, leading to backlogs or crashes. Consider implementing message batching or throttling if appropriate. Isolate WebSocket Logic: Temporarily separate WebSocket handling from other network operations to see if it resolves the issue. This can help determine if the WebSocket connection is the root cause. Potential Solutions Limit WebSocket Message Size: If possible, configure the server to send smaller WebSocket messages or implement logic on the client to process messages in chunks. WebView Configuration: Experiment with different WKWebView configurations. For example, adjust settings like websiteDataStore or create separate configurations for different WebView instances to see if isolation helps. Handle Termination Gracefully: Implement logic to handle webViewWebContentProcessDidTerminate more effectively. Even if it’s not triggered consistently, having a fallback strategy to recreate the WebView and restore state could be beneficial. Network Reachability: Use NWPathMonitor to observe network changes and attempt to recover connections automatically when they drop. This can provide a more resilient network handling layer. App Restart Strategy: As a temporary measure, implement a strategy to inform users when the network becomes unusable and suggest restarting the app. Provide clear instructions to minimize disruption. Platform and Developer Engagement Reproduce Consistently: Ensure you can consistently reproduce the issue, ideally with a simplified test case. This will be crucial for debugging and for providing detailed information to Apple. Report a Bug: Given the nature of the issue, it’s important to report it to Apple through the Feedback Assistant. Include detailed steps to reproduce, logs, and any relevant information about the device and iOS version. Monitor Updates: Keep an eye on iOS updates and beta releases. Apple may address underlying issues related to network handling in subsequent releases. Conclusion This issue seems to be a complex interaction between WebSocket handling, network management, and possibly resource constraints on newer devices. By systematically diagnosing the problem, experimenting with different solutions, and engaging with Apple support, you can work towards resolving this issue and improving the stability of your app on affected devices.
Topic: Safari & Web SubTopic: General
Feb ’26
Reply to Can WKWebView automatically adjust its width and height based on the loaded content?
Loading an image ad inside a WKWebView and adjusting its dimensions based on the content can be tricky, especially if the document.body.scrollHeight doesn't provide accurate results. Here are some strategies you can use to dynamically size the WKWebView to fit the content, particularly images: Use Message Handlers for Dynamic Content Size One effective way to get the dimensions of loaded images is to use JavaScript message handlers to communicate size information back to the Swift side. Steps: Configure a Message Handler: Set up a message handler in your WKWebView to receive size information from JavaScript. import WebKit class WebViewController: UIViewController, WKNavigationDelegate { var webView: WKWebView! override func loadView() { let webConfiguration = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.navigationDelegate = self view = webView } override func viewDidLoad() { super.viewDidLoad() // Add message handler webView.configuration.userContentController.add(self, name: "imageSizeHandler") // Load the image ad if let url = URL(string: "https://example.com/your-image-ad.html") { let request = URLRequest(url: url) webView.load(request) } } // WKNavigationDelegate method func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { // Send JavaScript to get image sizes let script = "var images = document.querySelectorAll('img'); var sizes = []; for (var i = 0; i < images.length; i++) { sizes.push({ width: images[i].offsetWidth, height: images[i].offsetHeight }); } window.webkit.messageHandlers.imageSizeHandler.postMessage(sizes);" webView.evaluateJavaScript(script) } } extension WebViewController: WKScriptMessageHandler { func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { if message.name == "imageSizeHandler", let sizes = message.body as? [[String: CGFloat]] { // Adjust webView's frame based on received sizes adjustWebViewSize(for: sizes) } } func adjustWebViewSize(for sizes: [[String: CGFloat]]) { // Assuming you want to fit the largest image guard let largestImage = sizes.max(by: { $0["width"]! * $0["height"]! < $1["width"]! * $1["height"]! }) else { return } let newHeight = largestImage["height"]! * (webView.frame.width / largestImage["width"]!) webView.frame.size = CGSize(width: webView.frame.width, height: newHeight) } } JavaScript to Measure Image Sizes: The JavaScript embedded in the page calculates the dimensions of all images and sends them back via the message handler. Observe Content Size Changes Alternatively, you can observe changes to the contentSize property of the WKWebView, although this might not always accurately reflect image sizes until they are fully loaded. Steps: override func viewDidLoad() { super.viewDidLoad() webView.addObserver(self, forKeyPath: "contentSize", options: .new, context: nil) } override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { if keyPath == "contentSize" { // Adjust webView's frame based on new content size webView.frame.size = change?[ .newKey ] as? CGSize ?? webView.frame.size } } deinit { webView.removeObserver(self, forKeyPath: "contentSize") } Considerations Image Loading Delays: Images might load at different times, so sizes might be reported incrementally. Consider handling partial updates or waiting for a stable size report. Complex Pages: If the page contains dynamic content or iframes, additional logic might be needed to capture all relevant images. Performance: Continuously observing content size or executing JavaScript can impact performance. Balance between accuracy and efficiency. By using message handlers, you can get more precise control over sizing the WKWebView based on the actual content it loads, particularly images. This approach should provide more reliable results than relying solely on document.body.scrollHeight.
Topic: Safari & Web SubTopic: General Tags:
Feb ’26
Reply to CSS Grid subpixel column width misalignment at non-100% zoom levels in Safari
The issue you're encountering with CSS grid columns misaligning at certain zoom levels, despite using fractional widths, is likely due to subpixel rounding behavior inherent in rendering engines. Here's a deeper dive into why this happens and some potential strategies to mitigate it: Understanding the Issue Fractional Widths and Subpixel Precision: CSS fractional widths (e.g., 518.7875px) aim to distribute space precisely across columns. However, rendering engines often round these values to the nearest whole pixel to fit display resolutions, which can lead to misalignment, especially noticeable at non-100% zoom levels. Subpixel Rounding: At zoom levels like 85% or 115%, the pixel grid becomes more pronounced, and small rounding discrepancies can become visually apparent, causing columns to appear misaligned with background patterns or other elements. Device Display Scaling: MacBook models with Retina displays use higher pixel densities, which can exacerbate subpixel rounding issues when combined with fractional widths and varying zoom levels. Strategies to Mitigate Misalignment Use box-sizing: border-box: Ensure that box-sizing: border-box is applied to grid items to include padding and borders in the width calculation, which can help maintain alignment. .grid-container { display: grid; grid-template-columns: repeat(3, 518.7875px); box-sizing: border-box; } Adjust Column Widths for Specific Zoom Levels: Use media queries to adjust column widths slightly at specific zoom levels to compensate for rounding errors. This can be done using @media queries with device-pixel-ratio or JavaScript to detect zoom levels. @media screen and (device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 1.5) { .grid-container { grid-template-columns: repeat(3, calc(518.7875px - 1px)); /* Adjust as needed */} } Snap Grid to Pixel Grid: Use transform to snap grid items to the nearest pixel boundary, which can help reduce visual misalignment. .grid-item { transform: translateX(calc((round(1000 * (left + border-left-width)) / 1000) - left - border-left-width)); } This approach calculates the precise pixel position and adjusts the item accordingly, but it may require careful handling to ensure it works across different layouts and zoom levels. Round Column Widths in JavaScript: Calculate and round column widths dynamically using JavaScript to ensure they align with the pixel grid. const gridContainer = document.querySelector('.grid-container'); const totalWidth = gridContainer.clientWidth; const columnCount = 3; const baseWidth = totalWidth / columnCount; const roundedWidth = Math.round(baseWidth * 1000) / 1000; gridContainer.style.gridTemplateColumns = repeat(${columnCount}, ${roundedWidth}px); This script recalculates column widths on the fly, ensuring they align with the pixel grid at any zoom level. Use Fixed-Width Columns with Spacing: If fractional widths continue to cause issues, consider using fixed-width columns with calculated spacing to achieve a similar layout. .grid-container { display: grid; grid-template-columns: repeat(3, 510px); /* Fixed width / gap: 8.7875px; / Adjust spacing to match fractional total */ } Test Across Devices and Zoom Levels: Thoroughly test your layout across different MacBook models and zoom levels to identify specific patterns of misalignment. This will help you fine-tune your approach for your target audience. By implementing these strategies, you can minimize subpixel rounding issues and achieve more consistent column alignment in your CSS grid layouts across various zoom levels and device displays.
Topic: Safari & Web SubTopic: General Tags:
Feb ’26
Reply to A blank keyboard appear in safari view controller
Encountering a blank keyboard in a SafariViewController on iPadOS 26+ can be frustrating, especially for enterprise applications. Here are some potential causes and solutions to help you diagnose and fix the issue: Potential Causes Compatibility Issues with iPadOS 26+: Recent changes in iPadOS might affect how SafariViewController handles keyboard presentation, particularly for enterprise apps. View Controller Presentation Style: The way the SafariViewController is presented might interfere with its ability to properly display the keyboard. Conflicting Settings or Permissions: Enterprise settings or restrictions might inadvertently affect keyboard functionality within web views. Web Content or JavaScript Issues: Specific content or scripts on the webpage might interfere with keyboard initialization or rendering. Safe Area Insets or Layout Issues: Incorrect handling of safe area insets or layout constraints might cause the keyboard to appear blank or off-screen. Solutions and Workarounds Ensure Proper Presentation Style: Always present SafariViewController using a standard method like present(_:animated:completion:). Avoid custom transitions that might disrupt its lifecycle. Check Safe Area Insets: Ensure that your view controller's layout respects safe area insets. Adjust constraints if necessary to prevent the keyboard from being obscured or improperly rendered. Handle Keyboard Notifications: Register for keyboard notifications (UIKeyboardWillShowNotification, UIKeyboardWillHideNotification) to adjust your view's layout dynamically. This can help ensure the keyboard appears correctly. Test with Different Web Content: Isolate the issue by testing with different web pages to determine if the problem is specific to certain content or scripts. This can help identify if external factors are causing the issue. Review Enterprise Settings: Consult with your enterprise IT department to ensure there are no restrictions or policies affecting keyboard functionality within web views. Look for settings related to content blocking, security, or accessibility. Check for Known Issues or Updates: Investigate if there are any known issues with SafariViewController on iPadOS 26+ and check for updates to Apple's frameworks or your app that might address these issues. Temporary Workaround - Adjust Window Size: As you've noted, resizing the window can temporarily resolve the issue. This might suggest a layout or rendering problem that can be addressed by ensuring consistent layout behavior across different screen sizes. Custom Keyboard Handling: If feasible, consider implementing a custom keyboard or web view solution to bypass potential issues with SafariViewController. This approach requires more effort but can offer greater control over keyboard presentation. Debugging with Instruments: Use Xcode's Instruments to profile the app and identify any performance bottlenecks or rendering issues that might be causing the blank keyboard. Pay particular attention to the keyboard's lifecycle and view hierarchy updates. Example Code Adjustments Here's a basic example of how you might handle keyboard notifications to adjust your view's layout: import UIKit import SafariServices class MyViewController: UIViewController, SFSafariViewControllerDelegate { override func viewDidLoad() { super.viewDidLoad() NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil) } @objc func keyboardWillShow(_ notification: Notification) { if let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect { view.frame.origin.y = -keyboardFrame.height } } @objc func keyboardWillHide(_ notification: Notification) { view.frame.origin.y = 0 } func presentSafariViewController() { let safariVC = SFSafariViewController(url: URL(string: "https://example.com")!) safariVC.delegate = self present(safariVC, animated: true, completion: nil) } } By implementing these strategies, you should be able to diagnose and resolve the blank keyboard issue in your SafariViewController on iPadOS 26+. If the problem persists, consider reaching out to Apple Support for further assistance.
Topic: Safari & Web SubTopic: General Tags:
Feb ’26
Reply to Unable to load a quantized Qwen 1.7B model on an iPhone SE 3
Running large models like Qwen3 1.7B on devices with limited resources, such as the iPhone SE 3 with 4 GB of RAM, is indeed challenging. Let's address your questions and explore potential approaches to mitigate the issues you're facing: Observations and Possible Causes Memory Spike During Load: Dynamic Shape Usage: While dynamic shapes can help manage memory allocation during inference by not preallocating for the full context length, the initial loading process often requires more fixed memory to parse the model, set up internal structures, and potentially convert certain operations to formats supported by the hardware. Intermediate Conversion: Core ML might internally convert some operations from INT4 to INT8 or FP16 if the underlying hardware (BNNS/ANE) doesn't natively support INT4 operations. This can cause temporary spikes in memory usage during loading. Memory Limitations: The iPhone SE 3's 4 GB RAM is quite limited for large models, especially if additional overhead from the operating system and other processes is considered. The jetsam threshold you're hitting (~2 GB) is a hard limit imposed to prevent apps from consuming too much memory and crashing the device. Potential Solutions and Approaches Model Splitting: Partial Loading: Consider splitting the model into smaller segments that can be loaded and processed independently. For instance, you could load and process the model in chunks of the context length, handling each chunk sequentially. Layer-wise Execution: Implement layer-wise execution where each layer of the model is loaded and processed one at a time, reducing peak memory usage. Further Quantization: Activation Quantization: As you mentioned, activation quantization might help reduce memory usage during inference. While it primarily impacts runtime memory, it could indirectly reduce the memory spike during loading by decreasing the size of intermediate tensors. Post-Training Quantization Techniques: Explore advanced quantization techniques such as QAT (Quantization-Aware Training) or knowledge distillation to create a more compact model tailored for low-memory devices. On-Device Model Compression: Use tools or libraries designed for model compression to reduce the model size further. Techniques like pruning, sparsity, or knowledge distillation can help create a smaller model without significantly impacting performance. Offloading Computation: Consider offloading some computation to a server or another device with more resources. This approach requires a reliable network connection and may introduce latency, but it can enable running larger models on constrained devices. Custom Inference Engine: Implement a custom inference engine optimized for the specific hardware capabilities of the iPhone SE 3. This could involve manually managing memory allocation and leveraging low-level optimizations to reduce peak memory usage. Reducing Context Length: If the application's requirements allow, reduce the context length to decrease the model's size and memory footprint. This can be done during model conversion or by adjusting the model's configuration at runtime. Profiling and Optimization: Continue profiling the loading process to identify specific operations or data structures causing the memory spike. Optimize these areas by reducing intermediate tensor sizes or using more memory-efficient algorithms. Community and Support Check for Community Solutions: Look for similar issues reported by other developers in forums, such as Stack Overflow or Apple Developer forums. They might have shared workarounds or solutions that could be applicable to your case. Apple Developer Support: If the problem persists, consider reaching out to Apple Developer Support. They can provide guidance specific to your model and device configuration. By exploring these approaches, you may be able to find a viable solution for running the Qwen3 1.7B model on the iPhone SE 3, even with its memory constraints.
Topic: Machine Learning & AI SubTopic: Core ML Tags:
Feb ’26
Reply to Massive CoreML latency spike on live AVFoundation camera feed vs. offline inference (CPU+ANE)
Experiencing significant performance degradation when running CoreML models on live AVFoundation video feeds compared to offline inference is a common issue, though the exact cause can vary based on several factors. Given the details you've provided, here are some insights and potential solutions to consider: Potential Causes and Solutions ANE Power State Management: Observation: Your suspicion about ANE (Apple Neural Engine) power state issues seems plausible, especially with the noted variability in debug mode and when introducing dummy computations. Solution: The ANE may enter a low-power state when idle, causing latency spikes when reactivated for inference. To mitigate this, consider keeping the ANE active by scheduling low-intensity tasks periodically. However, avoid unnecessary computations that could impact overall performance. Approach: Use DispatchSourceTimer to run a very light task (e.g., a simple matrix multiplication) at regular intervals to keep the ANE primed. AVFoundation and CoreML Synchronization: Observation: Even with optimized preprocessing and model loading, synchronization overhead between AVFoundation and CoreML could contribute to latency. Solution: Minimize the overhead by ensuring that video frame capture and model inference are tightly coupled. Consider using CMSampleBufferDelegate methods to process frames as soon as they are available, reducing the time spent waiting for buffer completion. Thread Management: Observation: You've already set the dispatch queue to .userInteractive, but further thread management might improve performance. Solution: Ensure that all video processing and inference tasks are executed on a dedicated background thread to avoid blocking the main thread. Use DispatchQueue.global(qos: .userInteractive) for these tasks. Model Optimization: Observation: While you've applied INT8 quantization, further model optimizations might yield better results. Solution: Experiment with model pruning, quantization-aware training, or using smaller model architectures to reduce inference time. Additionally, ensure that the model's input/output shapes and data types are perfectly aligned with the AVFoundation feed. Frame Rate Considerations: Observation: Running inference at both 30fps and 60fps shows similar latency penalties, suggesting that frame rate is not the bottleneck. Solution: Consider adjusting the frame rate to balance between quality and performance. Lowering the frame rate slightly might reduce the load on the ANE without significantly impacting user experience. Debugging and Profiling: Observation: Debug mode inference is faster, indicating potential runtime overhead in release mode. Solution: Continue profiling in both modes to identify specific bottlenecks. Use Instruments to analyze CPU and ANE usage, focusing on any unexpected delays or power state transitions. Frame Dropping and Latency: Observation: No frames are being dropped, but latency remains high. Solution: Ensure that the camera feed and inference pipeline are not overwhelming the system's resources. Monitor memory and CPU usage to prevent contention that could lead to increased latency. Apple-Recommended Patterns Preloading and Reusing Resources: You've already implemented these, but ensure that resources like pixel buffers and models are efficiently managed and reused throughout the session. Adaptive Inference: Consider implementing adaptive inference strategies, where the model's complexity or resolution is adjusted based on real-time performance metrics or scene complexity. Background Task Scheduling: Use UIApplication.beginBackgroundTask to extend the time available for processing frames if necessary, ensuring that the task completes before the app is suspended. If none of these solutions resolve the issue, it may be worthwhile to reach out to Apple Developer Support, providing them with your detailed profiling data and reproduction steps. They may be able to offer specific guidance or identify potential bugs in the frameworks.
Topic: Machine Learning & AI SubTopic: Core ML Tags:
Feb ’26
Reply to iOS Mac OS Portal Detection over Wi-Fi: no DNS A Query
It sounds like you're encountering a known issue related to how iOS handles captive portals, particularly when websites are only accessible via IPv4. Apple has been aware of certain behaviors where iOS might prioritize IPv6 over IPv4, leading to incomplete captive portal experiences if the necessary IPv4 infrastructure isn't present. Here are a few points and potential workarounds you might consider: Understanding the Behavior: iOS is designed to prefer IPv6 when both are available because it's generally faster and more efficient. However, this can cause issues on networks that only support IPv4 for certain services, like captive portal pages. iOS and iPadOS Versions: Apple has made various improvements to captive portal handling across different iOS versions. While I don't have specific details on version 36.2, issues related to IPv6 preference have been addressed in updates prior to and possibly after this version. Ensuring your devices are running the latest compatible version of iOS/iPadOS is always a good practice. Network Configuration: Dual-Stack Configuration: Ensure your network is configured to support Dual-Stack IPv4/IPv6. This setup allows devices to use IPv6 when available but fall back to IPv4 when necessary. Force IPv4 for Captive Portals: Some network equipment allows you to enforce IPv4-only access for captive portal pages. This can be a workaround if your network supports such a configuration. Mitigation Strategies: Manual IPv4 Force: On affected devices, you can try forcing an IPv4 connection by disabling Wi-Fi, turning on Airplane Mode, re-enabling Wi-Fi, and then connecting to the network. This sometimes resets the network stack to prioritize IPv4. Alternative DNS Servers: Consider using DNS servers that prioritize IPv4 responses. Public DNS services like Google DNS (8.8.8.8, 8.8.4.4) or Cloudflare DNS (1.1.1.1) can sometimes help mitigate this issue. Apple Feedback: If this issue persists and significantly impacts your users, consider providing feedback to Apple through the Developer Feedback Assistant. Detailed logs and descriptions of the environment can help Apple diagnose and address the problem in future updates.
Feb ’26
Reply to Question about personal account switching to organization
You can start by signing up for a personal Apple ID and later switch to an Apple Developer account for your LLC. Here's how it generally works: Personal Apple ID: Signing up for a personal Apple ID is quick and doesn't require a DUNS number. It allows you to explore the App Store, download developer resources, and familiarize yourself with the development environment. Switching to an Apple Developer Account: Once you have your DUNS number and are ready to publish apps under your LLC, you can enroll in the Apple Developer Program. During this process, you'll be able to convert your personal Apple ID into the Apple ID for your developer account. This means you won't lose any data or settings associated with your personal account, such as purchase history or app downloads. Benefits of Waiting: If you prefer to have everything set up under your LLC's name from the start, waiting until you receive your DUNS number might make sense. This way, your developer account will reflect your business identity from the beginning. Ultimately, starting with a personal account allows you to get a head start on learning and developing, while switching to a developer account later is straightforward once you're ready to go live with your apps. Just ensure you have all necessary business information, like your DUNS number and legal entity details, ready when you enroll in the developer program. -Applei
Feb ’26
Reply to Apple App Store
Es tut mir leid zu hören, dass Sie Probleme mit der App Store-Leistung auf Ihrer Beta 2 iOS 26.4-Version haben. Hier sind ein paar Schritte, die Sie ausprobieren könnten, um die Situation zu verbessern: Neustart des Geräts: Manchmal kann ein einfacher Neustart helfen, kleinere Softwareprobleme zu beheben. Prüfen auf Updates: Stellen Sie sicher, dass Sie die neuesten Beta-Updates installiert haben. Manchmal werden in nachfolgenden Beta-Versionen Leistungsverbesserungen vorgenommen. Schließen anderer Apps: Stellen Sie sicher, dass nicht zu viele Apps im Hintergrund laufen, da diese die Leistung beeinträchtigen können. Freier Speicherplatz: Prüfen Sie, ob auf Ihrem Gerät noch ausreichend Speicherplatz vorhanden ist. Ein Mangel an Speicherplatz kann die Leistung beeinträchtigen. Temporäre Dateien löschen: Gehen Sie zu "Einstellungen > Allgemein > iPhone-Speicher" und löschen Sie temporäre Dateien oder Apps, die Sie nicht mehr benützen. Netzwerkverbindung prüfen: Stellen Sie sicher, dass Sie eine stabile und schnelle Internetverbindung haben, da eine langsame Verbindung die App Store-Leistung beeinträchtigen kann. Siri-Vorschläge deaktivieren: Gehen Sie zu "Einstellungen > Siri & Suchen" und deaktivieren Sie "Siri-Vorschläge". Dies kann helfen, die Last auf dem System zu reduzieren. Falls das Problem weiterhin besteht, könnte es hilfreich sein, das Feedback-Tool auf Ihrem Gerät zu verwenden, um Apple über das Problem zu informieren. Sie sammeln möglicherweise weitere Informationen, die bei der Fehlerbehebung helfen können.
Feb ’26
Reply to macOS ADCertificate Managed Payload – Auto-Renewal Not Working
Experiencing issues with ADCertificate auto-renewal on macOS devices enrolled via MDM, especially with Microsoft AD CS, can be challenging due to the interplay between different systems. While Apple's documentation and community forums may not always cover every specific scenario, here are some insights, potential causes, and troubleshooting steps based on common issues and best practices: Known Issues and Considerations MDM and Certificate Renewal Limitations: macOS's support for auto-renewing certificates via MDM has certain limitations and might not be as robust as on iOS. Microsoft AD CS integration can add complexity, particularly if certificate templates or renewal settings are not aligned. Certificate Template Configuration: Ensure that the AD CS certificate template used supports renewal and is configured correctly. The template should have settings for auto-enrollment and renewal, typically under the "Extensions" tab in the template properties. Check the "Renewal Policy" settings to ensure they align with your desired renewal interval and conditions. Kerberos Authentication: Ensure that the MDM server and client machines have proper Kerberos authentication configured. Certificate renewal often relies on Kerberos tickets, and misconfigurations can lead to renewal failures. Time Synchronization: Accurate time synchronization is crucial for certificate operations. Ensure that both the AD domain controllers and macOS devices are synchronized with a reliable time server. Event Logs: Review event logs on both the macOS devices and the AD CS servers for clues. On macOS, check the System.log and Security.log for certificate-related errors. On the AD CS server, look in the Application and System logs for certificate enrollment and renewal events. Troubleshooting Steps Verify Payload Configuration: Double-check your MDM payload configuration to ensure all fields are correctly set, especially EnableAutoRenewal and CertTemplate. Ensure that CertificateRenewalTimeInterval provides enough time for renewal before the certificate expires. Test Manual Renewal: Temporarily disable auto-renewal and manually enroll a certificate to verify that the process works as expected. This can help isolate whether the issue lies with auto-renewal or the initial enrollment. Check Certificate Chain: Ensure that the AD CS server's certificate chain is complete and properly trusted on the macOS devices. Intermediate certificates must be installed and trusted for chain validation to succeed. Update MDM and macOS: Ensure that both your MDM solution and the macOS devices are running the latest compatible versions. Updates may include bug fixes or improvements related to certificate management. Consult Microsoft and Apple Support: Given the complexity of the issue, consider reaching out to both Microsoft support (for AD CS) and Apple support (for MDM and macOS). They may have specific guidance or patches related to your configuration. Community and Forums: Explore community forums such as Apple Developer Forums, Microsoft Tech Community, and MDM-specific communities. Other users may have encountered similar issues and found solutions. Alternative Approaches If auto-renewal continues to be problematic, consider alternative approaches such as: Script-Based Renewal: Implement a script to manually renew the certificate before it expires. This can be scheduled using launchd or cron on macOS. Third-Party MDM Solutions: Investigate third-party MDM solutions that may offer more robust certificate management features and better compatibility with Microsoft AD CS. By systematically addressing these areas, you can identify and resolve the factors preventing ADCertificate auto-renewal on your macOS devices. If the issue persists, engaging with support teams will be crucial to finding a tailored solution.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to Calling a Objc method directly from C
Calling Objective-C directly from C is certainly possible and can simplify your codebase by eliminating intermediate layers. Additionally, using Grand Central Dispatch (GCD) to manage thread safety and dispatch tasks to Objective-C contexts is a sound approach. Below, I'll outline how you can achieve this, maintaining thread safety and leveraging GCD effectively. Direct Objective-C Function Call from C Assuming you have an Objective-C method you want to call directly from C, you can use the Objective-C runtime functions to achieve this. Here's a step-by-step guide: Objective-C Method Declaration First, ensure your Objective-C method is declared properly. For example: @interface Renderer : NSObject (void)mtlEnd; @end C Function to Call Objective-C Method You can define a C function that uses the Objective-C runtime to call the mtlEnd method: #include <objc/runtime.h> void mtlEnd(MTRenderContext mt_ctx) { // Retrieve the class of the render context Class rendererClass = mt_ctx->mt_render_funcs.mtlObj.isa; // Get the selector for the mtlEnd method SEL selector = @selector(mtlEnd); // Find the implementation of the method IMP implementation = class_getInstanceMethod(rendererClass, selector); // Call the method using the IMP void (*func)(id, SEL) = (void (*)(id, SEL))implementation; func(mt_ctx->mt_render_funcs.mtlObj, selector); } Thread Safety with GCD To ensure thread safety when calling Objective-C code from C, you can use GCD to dispatch the call to a specific thread or queue. Here's how you can incorporate a lock using dispatch_queue_t: #include <dispatch/dispatch.h> // Create a serial dispatch queue for thread safety static dispatch_queue_t renderQueue = dispatch_queue_create("com.yourapp.renderQueue", DISPATCH_QUEUE_SERIAL); void mtlEnd(MTRenderContext mt_ctx) { dispatch_async(renderQueue, ^{ // Retrieve the class of the render context Class rendererClass = mt_ctx->mt_render_funcs.mtlObj.isa; // Get the selector for the mtlEnd method SEL selector = @selector(mtlEnd); // Find the implementation of the method IMP implementation = class_getInstanceMethod(rendererClass, selector); // Call the method using the IMP void (*func)(id, SEL) = (void (*)(id, SEL))implementation; func(mt_ctx->mt_render_funcs.mtlObj, selector); }); } Explanation Objective-C Runtime: Functions like class_getInstanceMethod and IMP are used to dynamically invoke Objective-C methods from C. GCD for Thread Safety: By dispatching the method call to a serial queue (renderQueue), you ensure that only one thread executes the Objective-C code at a time, preventing race conditions. Serial Queue: DISPATCH_QUEUE_SERIAL ensures FIFO execution, maintaining the order of operations and protecting shared resources. Integration Ensure your C and Objective-C files are properly linked in your Xcode project. Compile with the necessary flags to support Objective-C runtime functions (usually -framework Foundation). This approach allows you to maintain a C foundation for your application while efficiently leveraging Objective-C's capabilities, particularly for tasks like rendering with Metal, and ensures thread safety using GCD.
Topic: Programming Languages SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to iOS26.2 webview use websocket cause net lose
Encountering a network issue in WKWebView on iPhone 15 models with iOS 16.2, particularly under conditions of frequent large WebSocket data packets, is indeed unusual and concerning. This issue seems to affect the entire network stack for the app, which points to a deeper problem possibly related to resource exhaustion or a bug in handling network resources. Here are some steps and considerations to help diagnose and potentially resolve this issue: Diagnostic Steps Monitor Resource Usage: Use Instruments on macOS to monitor the app’s resource usage, especially focusing on CPU, memory, and network activity when the issue occurs. Look for spikes or anomalies that could indicate resource exhaustion. Check for Leaks: Ensure there are no memory leaks in your WebView handling code. Leaks can gradually consume resources, leading to instability. Instruments can also help identify memory leaks. Network Activity Logging: Log network activity to understand what happens when connections time out. Use URLSession’s delegate methods or third-party libraries to capture detailed logs of network requests and responses. WebSocket Message Handling: Examine how your app processes incoming WebSocket messages. Large messages might not be handled efficiently, leading to backlogs or crashes. Consider implementing message batching or throttling if appropriate. Isolate WebSocket Logic: Temporarily separate WebSocket handling from other network operations to see if it resolves the issue. This can help determine if the WebSocket connection is the root cause. Potential Solutions Limit WebSocket Message Size: If possible, configure the server to send smaller WebSocket messages or implement logic on the client to process messages in chunks. WebView Configuration: Experiment with different WKWebView configurations. For example, adjust settings like websiteDataStore or create separate configurations for different WebView instances to see if isolation helps. Handle Termination Gracefully: Implement logic to handle webViewWebContentProcessDidTerminate more effectively. Even if it’s not triggered consistently, having a fallback strategy to recreate the WebView and restore state could be beneficial. Network Reachability: Use NWPathMonitor to observe network changes and attempt to recover connections automatically when they drop. This can provide a more resilient network handling layer. App Restart Strategy: As a temporary measure, implement a strategy to inform users when the network becomes unusable and suggest restarting the app. Provide clear instructions to minimize disruption. Platform and Developer Engagement Reproduce Consistently: Ensure you can consistently reproduce the issue, ideally with a simplified test case. This will be crucial for debugging and for providing detailed information to Apple. Report a Bug: Given the nature of the issue, it’s important to report it to Apple through the Feedback Assistant. Include detailed steps to reproduce, logs, and any relevant information about the device and iOS version. Monitor Updates: Keep an eye on iOS updates and beta releases. Apple may address underlying issues related to network handling in subsequent releases. Conclusion This issue seems to be a complex interaction between WebSocket handling, network management, and possibly resource constraints on newer devices. By systematically diagnosing the problem, experimenting with different solutions, and engaging with Apple support, you can work towards resolving this issue and improving the stability of your app on affected devices.
Topic: Safari & Web SubTopic: General
Replies
Boosts
Views
Activity
Feb ’26
Reply to Can WKWebView automatically adjust its width and height based on the loaded content?
Loading an image ad inside a WKWebView and adjusting its dimensions based on the content can be tricky, especially if the document.body.scrollHeight doesn't provide accurate results. Here are some strategies you can use to dynamically size the WKWebView to fit the content, particularly images: Use Message Handlers for Dynamic Content Size One effective way to get the dimensions of loaded images is to use JavaScript message handlers to communicate size information back to the Swift side. Steps: Configure a Message Handler: Set up a message handler in your WKWebView to receive size information from JavaScript. import WebKit class WebViewController: UIViewController, WKNavigationDelegate { var webView: WKWebView! override func loadView() { let webConfiguration = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.navigationDelegate = self view = webView } override func viewDidLoad() { super.viewDidLoad() // Add message handler webView.configuration.userContentController.add(self, name: "imageSizeHandler") // Load the image ad if let url = URL(string: "https://example.com/your-image-ad.html") { let request = URLRequest(url: url) webView.load(request) } } // WKNavigationDelegate method func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { // Send JavaScript to get image sizes let script = "var images = document.querySelectorAll('img'); var sizes = []; for (var i = 0; i < images.length; i++) { sizes.push({ width: images[i].offsetWidth, height: images[i].offsetHeight }); } window.webkit.messageHandlers.imageSizeHandler.postMessage(sizes);" webView.evaluateJavaScript(script) } } extension WebViewController: WKScriptMessageHandler { func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { if message.name == "imageSizeHandler", let sizes = message.body as? [[String: CGFloat]] { // Adjust webView's frame based on received sizes adjustWebViewSize(for: sizes) } } func adjustWebViewSize(for sizes: [[String: CGFloat]]) { // Assuming you want to fit the largest image guard let largestImage = sizes.max(by: { $0["width"]! * $0["height"]! < $1["width"]! * $1["height"]! }) else { return } let newHeight = largestImage["height"]! * (webView.frame.width / largestImage["width"]!) webView.frame.size = CGSize(width: webView.frame.width, height: newHeight) } } JavaScript to Measure Image Sizes: The JavaScript embedded in the page calculates the dimensions of all images and sends them back via the message handler. Observe Content Size Changes Alternatively, you can observe changes to the contentSize property of the WKWebView, although this might not always accurately reflect image sizes until they are fully loaded. Steps: override func viewDidLoad() { super.viewDidLoad() webView.addObserver(self, forKeyPath: "contentSize", options: .new, context: nil) } override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { if keyPath == "contentSize" { // Adjust webView's frame based on new content size webView.frame.size = change?[ .newKey ] as? CGSize ?? webView.frame.size } } deinit { webView.removeObserver(self, forKeyPath: "contentSize") } Considerations Image Loading Delays: Images might load at different times, so sizes might be reported incrementally. Consider handling partial updates or waiting for a stable size report. Complex Pages: If the page contains dynamic content or iframes, additional logic might be needed to capture all relevant images. Performance: Continuously observing content size or executing JavaScript can impact performance. Balance between accuracy and efficiency. By using message handlers, you can get more precise control over sizing the WKWebView based on the actual content it loads, particularly images. This approach should provide more reliable results than relying solely on document.body.scrollHeight.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to CSS Grid subpixel column width misalignment at non-100% zoom levels in Safari
The issue you're encountering with CSS grid columns misaligning at certain zoom levels, despite using fractional widths, is likely due to subpixel rounding behavior inherent in rendering engines. Here's a deeper dive into why this happens and some potential strategies to mitigate it: Understanding the Issue Fractional Widths and Subpixel Precision: CSS fractional widths (e.g., 518.7875px) aim to distribute space precisely across columns. However, rendering engines often round these values to the nearest whole pixel to fit display resolutions, which can lead to misalignment, especially noticeable at non-100% zoom levels. Subpixel Rounding: At zoom levels like 85% or 115%, the pixel grid becomes more pronounced, and small rounding discrepancies can become visually apparent, causing columns to appear misaligned with background patterns or other elements. Device Display Scaling: MacBook models with Retina displays use higher pixel densities, which can exacerbate subpixel rounding issues when combined with fractional widths and varying zoom levels. Strategies to Mitigate Misalignment Use box-sizing: border-box: Ensure that box-sizing: border-box is applied to grid items to include padding and borders in the width calculation, which can help maintain alignment. .grid-container { display: grid; grid-template-columns: repeat(3, 518.7875px); box-sizing: border-box; } Adjust Column Widths for Specific Zoom Levels: Use media queries to adjust column widths slightly at specific zoom levels to compensate for rounding errors. This can be done using @media queries with device-pixel-ratio or JavaScript to detect zoom levels. @media screen and (device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 1.5) { .grid-container { grid-template-columns: repeat(3, calc(518.7875px - 1px)); /* Adjust as needed */} } Snap Grid to Pixel Grid: Use transform to snap grid items to the nearest pixel boundary, which can help reduce visual misalignment. .grid-item { transform: translateX(calc((round(1000 * (left + border-left-width)) / 1000) - left - border-left-width)); } This approach calculates the precise pixel position and adjusts the item accordingly, but it may require careful handling to ensure it works across different layouts and zoom levels. Round Column Widths in JavaScript: Calculate and round column widths dynamically using JavaScript to ensure they align with the pixel grid. const gridContainer = document.querySelector('.grid-container'); const totalWidth = gridContainer.clientWidth; const columnCount = 3; const baseWidth = totalWidth / columnCount; const roundedWidth = Math.round(baseWidth * 1000) / 1000; gridContainer.style.gridTemplateColumns = repeat(${columnCount}, ${roundedWidth}px); This script recalculates column widths on the fly, ensuring they align with the pixel grid at any zoom level. Use Fixed-Width Columns with Spacing: If fractional widths continue to cause issues, consider using fixed-width columns with calculated spacing to achieve a similar layout. .grid-container { display: grid; grid-template-columns: repeat(3, 510px); /* Fixed width / gap: 8.7875px; / Adjust spacing to match fractional total */ } Test Across Devices and Zoom Levels: Thoroughly test your layout across different MacBook models and zoom levels to identify specific patterns of misalignment. This will help you fine-tune your approach for your target audience. By implementing these strategies, you can minimize subpixel rounding issues and achieve more consistent column alignment in your CSS grid layouts across various zoom levels and device displays.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to A blank keyboard appear in safari view controller
Encountering a blank keyboard in a SafariViewController on iPadOS 26+ can be frustrating, especially for enterprise applications. Here are some potential causes and solutions to help you diagnose and fix the issue: Potential Causes Compatibility Issues with iPadOS 26+: Recent changes in iPadOS might affect how SafariViewController handles keyboard presentation, particularly for enterprise apps. View Controller Presentation Style: The way the SafariViewController is presented might interfere with its ability to properly display the keyboard. Conflicting Settings or Permissions: Enterprise settings or restrictions might inadvertently affect keyboard functionality within web views. Web Content or JavaScript Issues: Specific content or scripts on the webpage might interfere with keyboard initialization or rendering. Safe Area Insets or Layout Issues: Incorrect handling of safe area insets or layout constraints might cause the keyboard to appear blank or off-screen. Solutions and Workarounds Ensure Proper Presentation Style: Always present SafariViewController using a standard method like present(_:animated:completion:). Avoid custom transitions that might disrupt its lifecycle. Check Safe Area Insets: Ensure that your view controller's layout respects safe area insets. Adjust constraints if necessary to prevent the keyboard from being obscured or improperly rendered. Handle Keyboard Notifications: Register for keyboard notifications (UIKeyboardWillShowNotification, UIKeyboardWillHideNotification) to adjust your view's layout dynamically. This can help ensure the keyboard appears correctly. Test with Different Web Content: Isolate the issue by testing with different web pages to determine if the problem is specific to certain content or scripts. This can help identify if external factors are causing the issue. Review Enterprise Settings: Consult with your enterprise IT department to ensure there are no restrictions or policies affecting keyboard functionality within web views. Look for settings related to content blocking, security, or accessibility. Check for Known Issues or Updates: Investigate if there are any known issues with SafariViewController on iPadOS 26+ and check for updates to Apple's frameworks or your app that might address these issues. Temporary Workaround - Adjust Window Size: As you've noted, resizing the window can temporarily resolve the issue. This might suggest a layout or rendering problem that can be addressed by ensuring consistent layout behavior across different screen sizes. Custom Keyboard Handling: If feasible, consider implementing a custom keyboard or web view solution to bypass potential issues with SafariViewController. This approach requires more effort but can offer greater control over keyboard presentation. Debugging with Instruments: Use Xcode's Instruments to profile the app and identify any performance bottlenecks or rendering issues that might be causing the blank keyboard. Pay particular attention to the keyboard's lifecycle and view hierarchy updates. Example Code Adjustments Here's a basic example of how you might handle keyboard notifications to adjust your view's layout: import UIKit import SafariServices class MyViewController: UIViewController, SFSafariViewControllerDelegate { override func viewDidLoad() { super.viewDidLoad() NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil) } @objc func keyboardWillShow(_ notification: Notification) { if let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect { view.frame.origin.y = -keyboardFrame.height } } @objc func keyboardWillHide(_ notification: Notification) { view.frame.origin.y = 0 } func presentSafariViewController() { let safariVC = SFSafariViewController(url: URL(string: "https://example.com")!) safariVC.delegate = self present(safariVC, animated: true, completion: nil) } } By implementing these strategies, you should be able to diagnose and resolve the blank keyboard issue in your SafariViewController on iPadOS 26+. If the problem persists, consider reaching out to Apple Support for further assistance.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to Unable to load a quantized Qwen 1.7B model on an iPhone SE 3
Running large models like Qwen3 1.7B on devices with limited resources, such as the iPhone SE 3 with 4 GB of RAM, is indeed challenging. Let's address your questions and explore potential approaches to mitigate the issues you're facing: Observations and Possible Causes Memory Spike During Load: Dynamic Shape Usage: While dynamic shapes can help manage memory allocation during inference by not preallocating for the full context length, the initial loading process often requires more fixed memory to parse the model, set up internal structures, and potentially convert certain operations to formats supported by the hardware. Intermediate Conversion: Core ML might internally convert some operations from INT4 to INT8 or FP16 if the underlying hardware (BNNS/ANE) doesn't natively support INT4 operations. This can cause temporary spikes in memory usage during loading. Memory Limitations: The iPhone SE 3's 4 GB RAM is quite limited for large models, especially if additional overhead from the operating system and other processes is considered. The jetsam threshold you're hitting (~2 GB) is a hard limit imposed to prevent apps from consuming too much memory and crashing the device. Potential Solutions and Approaches Model Splitting: Partial Loading: Consider splitting the model into smaller segments that can be loaded and processed independently. For instance, you could load and process the model in chunks of the context length, handling each chunk sequentially. Layer-wise Execution: Implement layer-wise execution where each layer of the model is loaded and processed one at a time, reducing peak memory usage. Further Quantization: Activation Quantization: As you mentioned, activation quantization might help reduce memory usage during inference. While it primarily impacts runtime memory, it could indirectly reduce the memory spike during loading by decreasing the size of intermediate tensors. Post-Training Quantization Techniques: Explore advanced quantization techniques such as QAT (Quantization-Aware Training) or knowledge distillation to create a more compact model tailored for low-memory devices. On-Device Model Compression: Use tools or libraries designed for model compression to reduce the model size further. Techniques like pruning, sparsity, or knowledge distillation can help create a smaller model without significantly impacting performance. Offloading Computation: Consider offloading some computation to a server or another device with more resources. This approach requires a reliable network connection and may introduce latency, but it can enable running larger models on constrained devices. Custom Inference Engine: Implement a custom inference engine optimized for the specific hardware capabilities of the iPhone SE 3. This could involve manually managing memory allocation and leveraging low-level optimizations to reduce peak memory usage. Reducing Context Length: If the application's requirements allow, reduce the context length to decrease the model's size and memory footprint. This can be done during model conversion or by adjusting the model's configuration at runtime. Profiling and Optimization: Continue profiling the loading process to identify specific operations or data structures causing the memory spike. Optimize these areas by reducing intermediate tensor sizes or using more memory-efficient algorithms. Community and Support Check for Community Solutions: Look for similar issues reported by other developers in forums, such as Stack Overflow or Apple Developer forums. They might have shared workarounds or solutions that could be applicable to your case. Apple Developer Support: If the problem persists, consider reaching out to Apple Developer Support. They can provide guidance specific to your model and device configuration. By exploring these approaches, you may be able to find a viable solution for running the Qwen3 1.7B model on the iPhone SE 3, even with its memory constraints.
Topic: Machine Learning & AI SubTopic: Core ML Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to Massive CoreML latency spike on live AVFoundation camera feed vs. offline inference (CPU+ANE)
Experiencing significant performance degradation when running CoreML models on live AVFoundation video feeds compared to offline inference is a common issue, though the exact cause can vary based on several factors. Given the details you've provided, here are some insights and potential solutions to consider: Potential Causes and Solutions ANE Power State Management: Observation: Your suspicion about ANE (Apple Neural Engine) power state issues seems plausible, especially with the noted variability in debug mode and when introducing dummy computations. Solution: The ANE may enter a low-power state when idle, causing latency spikes when reactivated for inference. To mitigate this, consider keeping the ANE active by scheduling low-intensity tasks periodically. However, avoid unnecessary computations that could impact overall performance. Approach: Use DispatchSourceTimer to run a very light task (e.g., a simple matrix multiplication) at regular intervals to keep the ANE primed. AVFoundation and CoreML Synchronization: Observation: Even with optimized preprocessing and model loading, synchronization overhead between AVFoundation and CoreML could contribute to latency. Solution: Minimize the overhead by ensuring that video frame capture and model inference are tightly coupled. Consider using CMSampleBufferDelegate methods to process frames as soon as they are available, reducing the time spent waiting for buffer completion. Thread Management: Observation: You've already set the dispatch queue to .userInteractive, but further thread management might improve performance. Solution: Ensure that all video processing and inference tasks are executed on a dedicated background thread to avoid blocking the main thread. Use DispatchQueue.global(qos: .userInteractive) for these tasks. Model Optimization: Observation: While you've applied INT8 quantization, further model optimizations might yield better results. Solution: Experiment with model pruning, quantization-aware training, or using smaller model architectures to reduce inference time. Additionally, ensure that the model's input/output shapes and data types are perfectly aligned with the AVFoundation feed. Frame Rate Considerations: Observation: Running inference at both 30fps and 60fps shows similar latency penalties, suggesting that frame rate is not the bottleneck. Solution: Consider adjusting the frame rate to balance between quality and performance. Lowering the frame rate slightly might reduce the load on the ANE without significantly impacting user experience. Debugging and Profiling: Observation: Debug mode inference is faster, indicating potential runtime overhead in release mode. Solution: Continue profiling in both modes to identify specific bottlenecks. Use Instruments to analyze CPU and ANE usage, focusing on any unexpected delays or power state transitions. Frame Dropping and Latency: Observation: No frames are being dropped, but latency remains high. Solution: Ensure that the camera feed and inference pipeline are not overwhelming the system's resources. Monitor memory and CPU usage to prevent contention that could lead to increased latency. Apple-Recommended Patterns Preloading and Reusing Resources: You've already implemented these, but ensure that resources like pixel buffers and models are efficiently managed and reused throughout the session. Adaptive Inference: Consider implementing adaptive inference strategies, where the model's complexity or resolution is adjusted based on real-time performance metrics or scene complexity. Background Task Scheduling: Use UIApplication.beginBackgroundTask to extend the time available for processing frames if necessary, ensuring that the task completes before the app is suspended. If none of these solutions resolve the issue, it may be worthwhile to reach out to Apple Developer Support, providing them with your detailed profiling data and reproduction steps. They may be able to offer specific guidance or identify potential bugs in the frameworks.
Topic: Machine Learning & AI SubTopic: Core ML Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to iOS Mac OS Portal Detection over Wi-Fi: no DNS A Query
It sounds like you're encountering a known issue related to how iOS handles captive portals, particularly when websites are only accessible via IPv4. Apple has been aware of certain behaviors where iOS might prioritize IPv6 over IPv4, leading to incomplete captive portal experiences if the necessary IPv4 infrastructure isn't present. Here are a few points and potential workarounds you might consider: Understanding the Behavior: iOS is designed to prefer IPv6 when both are available because it's generally faster and more efficient. However, this can cause issues on networks that only support IPv4 for certain services, like captive portal pages. iOS and iPadOS Versions: Apple has made various improvements to captive portal handling across different iOS versions. While I don't have specific details on version 36.2, issues related to IPv6 preference have been addressed in updates prior to and possibly after this version. Ensuring your devices are running the latest compatible version of iOS/iPadOS is always a good practice. Network Configuration: Dual-Stack Configuration: Ensure your network is configured to support Dual-Stack IPv4/IPv6. This setup allows devices to use IPv6 when available but fall back to IPv4 when necessary. Force IPv4 for Captive Portals: Some network equipment allows you to enforce IPv4-only access for captive portal pages. This can be a workaround if your network supports such a configuration. Mitigation Strategies: Manual IPv4 Force: On affected devices, you can try forcing an IPv4 connection by disabling Wi-Fi, turning on Airplane Mode, re-enabling Wi-Fi, and then connecting to the network. This sometimes resets the network stack to prioritize IPv4. Alternative DNS Servers: Consider using DNS servers that prioritize IPv4 responses. Public DNS services like Google DNS (8.8.8.8, 8.8.4.4) or Cloudflare DNS (1.1.1.1) can sometimes help mitigate this issue. Apple Feedback: If this issue persists and significantly impacts your users, consider providing feedback to Apple through the Developer Feedback Assistant. Detailed logs and descriptions of the environment can help Apple diagnose and address the problem in future updates.
Replies
Boosts
Views
Activity
Feb ’26
Reply to Question about personal account switching to organization
You can start by signing up for a personal Apple ID and later switch to an Apple Developer account for your LLC. Here's how it generally works: Personal Apple ID: Signing up for a personal Apple ID is quick and doesn't require a DUNS number. It allows you to explore the App Store, download developer resources, and familiarize yourself with the development environment. Switching to an Apple Developer Account: Once you have your DUNS number and are ready to publish apps under your LLC, you can enroll in the Apple Developer Program. During this process, you'll be able to convert your personal Apple ID into the Apple ID for your developer account. This means you won't lose any data or settings associated with your personal account, such as purchase history or app downloads. Benefits of Waiting: If you prefer to have everything set up under your LLC's name from the start, waiting until you receive your DUNS number might make sense. This way, your developer account will reflect your business identity from the beginning. Ultimately, starting with a personal account allows you to get a head start on learning and developing, while switching to a developer account later is straightforward once you're ready to go live with your apps. Just ensure you have all necessary business information, like your DUNS number and legal entity details, ready when you enroll in the developer program. -Applei
Replies
Boosts
Views
Activity
Feb ’26
Reply to Apple App Store
Es tut mir leid zu hören, dass Sie Probleme mit der App Store-Leistung auf Ihrer Beta 2 iOS 26.4-Version haben. Hier sind ein paar Schritte, die Sie ausprobieren könnten, um die Situation zu verbessern: Neustart des Geräts: Manchmal kann ein einfacher Neustart helfen, kleinere Softwareprobleme zu beheben. Prüfen auf Updates: Stellen Sie sicher, dass Sie die neuesten Beta-Updates installiert haben. Manchmal werden in nachfolgenden Beta-Versionen Leistungsverbesserungen vorgenommen. Schließen anderer Apps: Stellen Sie sicher, dass nicht zu viele Apps im Hintergrund laufen, da diese die Leistung beeinträchtigen können. Freier Speicherplatz: Prüfen Sie, ob auf Ihrem Gerät noch ausreichend Speicherplatz vorhanden ist. Ein Mangel an Speicherplatz kann die Leistung beeinträchtigen. Temporäre Dateien löschen: Gehen Sie zu "Einstellungen > Allgemein > iPhone-Speicher" und löschen Sie temporäre Dateien oder Apps, die Sie nicht mehr benützen. Netzwerkverbindung prüfen: Stellen Sie sicher, dass Sie eine stabile und schnelle Internetverbindung haben, da eine langsame Verbindung die App Store-Leistung beeinträchtigen kann. Siri-Vorschläge deaktivieren: Gehen Sie zu "Einstellungen > Siri & Suchen" und deaktivieren Sie "Siri-Vorschläge". Dies kann helfen, die Last auf dem System zu reduzieren. Falls das Problem weiterhin besteht, könnte es hilfreich sein, das Feedback-Tool auf Ihrem Gerät zu verwenden, um Apple über das Problem zu informieren. Sie sammeln möglicherweise weitere Informationen, die bei der Fehlerbehebung helfen können.
Replies
Boosts
Views
Activity
Feb ’26