Foundation

RSS for tag

Access essential data types, collections, and operating-system services to define the base layer of functionality for your app using Foundation.

Posts under Foundation tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to save a point cloud in the sample code "Capturing depth using the LiDAR camera" with the photoOutput
Hello dear community, I have the sample code from Apple “CapturingDepthUsingLiDAR” to access the LiDAR on my iPhone 12 Pro. My goal is to use the “photo output” function to generate a point cloud from a single image and then save it as a ply file. So far I have tested different approaches to create a .ply file from the depthmap, the intrinsic camera data and the rgba values. Unfortunately, I have had no success so far and the result has always been an incorrect point cloud. My question now is whether there are already approaches to this and whether anyone has any experience with it. Thank you very much in advance!!!
1
0
470
Jan ’25
Crash:Exceeded system-wide per-process Port Limit
Hi everyone, I’m encountering a crash in my app and need help understanding what’s causing it and how to resolve it. As stated in the crash report, the issue is caused by exceeding the system-wide per-process port limit. Can you tell me how to locate and identify why this is happening? Below are the full report of the crash log: crash.log Summary of Crash: ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Incident Identifier: B509FF2B-C8D8-4E9F-B664-E24464CFD5F8 CrashReporter Key: b390cfe931a83efde49bd8b523023a275b55ef64 Hardware Model: iPhone14,2 Process: MyApp [22515] Path: /private/var/containers/Bundle/Application/F73212A7-4CB9-485A-A8B7-8114F4E9A9AB/MyApp.app/MyApp Identifier: com.beeasy.app.id.enterprise Version: 3.41.38-ID-MySDKMemory-12261114 (3.41.38-ID-MySDKMemory-12261114) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: com.beeasy.app.id.enterprise [515] Date/Time: 2024-12-29 01:29:48.3023 +0800 Launch Time: 2024-12-26 16:38:36.7895 +0800 OS Version: iPhone OS 16.6.1 (20G81) Release Type: User Baseband Version: 2.80.01 Report Version: 104 Exception Type: EXC_RESOURCE (SIGKILL) Exception Codes: 0x000000000001c1d6, 0x0000000000000000 Termination Reason: PORT_SPACE 14123288431433990614 (Limit 115158 ports) Exceeded system-wide per-process Port Limit Triggered by Thread: 64 Thread 64 name: AURemoteIO::IOThread Thread 64 Crashed: 0 libsystem_kernel.dylib 0x20ce5eca4 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x20ce71b74 mach_msg2_internal + 80 2 libsystem_kernel.dylib 0x20ce71e4c mach_msg_overwrite + 540 3 libsystem_kernel.dylib 0x20ce5f1e8 mach_msg + 24 4 libEmbeddedSystemAUs.dylib 0x238bb2148 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, AURemoteIO::IOThread::IOThread(AURemoteIO&, caulk::thread::attributes const&, caulk::mach::os_workgroup_managed const&)::'lambda'(), std::__1::tuple<>>>(void*) + 556 5 libsystem_pthread.dylib 0x22dcda6b8 _pthread_start + 148 6 libsystem_pthread.dylib 0x22dcd9b88 thread_start + 8
3
0
515
Jan ’25
URLSession downloadTask(with:) TimeOut Error NSURLErrorDomain Code=-1001, _kCFStreamErrorCodeKey=-2103
I have been battling this intermittent error for some time. It is generally random and has been difficult to reproduce until yesterday when I stumbled across a way to reproduce it each time. I can cause the code to throw this error: Task <70E3909F-8C30-4F34-A8B0-4AF3B41DD81B>.<1> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2103, _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundDownloadTask <70E3909F-8C30-4F34-A8B0-4AF3B41DD81B>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "BackgroundDownloadTask <70E3909F-8C30-4F34-A8B0-4AF3B41DD81B>.<1>", "LocalDownloadTask <70E3909F-8C30-4F34-A8B0-4AF3B41DD81B>.<1>" ), NSLocalizedDescription=The request timed out., _kCFStreamErrorDomainKey=4, NSErrorFailingURLStringKey=https://redacted*, NSErrorFailingURLKey=https://redacted*} *"redacted" is the backend URL, and it is the correct and same path for each immediately after restarting an actual device. I have been over the following threads with no results: What is kCFStreamErrorCodeKey=-4 (kCFStreamErrorDomainKey=4) Request timed out with _kCFStreamErrorCodeKey=60 How to better diagnose -1001 "The request timed out." URLSession errors Random timed out error on app start Because I was able to reproduce it, I have been able to get the following logs: Console Logs.txt Last bit of information is that I had Network Instruments running, and when this error occurred, I found that the Connection ID was "No Connection" and it appears the request was never actually sent, though it waited the full time out for a backend response. Any help would be appreciated. This data request is being used after sending a certain APNs to update necessary data in the background, and has been the source of many user complaints.
5
3
817
Feb ’25
Apple Mail and Drag&Drop
I have been trying to accept drops from Apple Mail which do supply data with type identifiers : com.apple.mail.email The problem is that even though the drop says it does contain items for com.apple.mail.email it does provide the items for com.apple.mail.email. Mail dropped from Microsoft Outlook however confirms to the protocols and returns the items for com.apple.mail.email Is this a known issue with Apple Mail and is there are reason for what seems to be a non-compliance to it own standards in Apple Mail?
0
0
372
Dec ’24
DateFormatter return wrong year
my Date type data is "2024-12-28 15:00:00 +0000" and when I use Date formatter to format date with timezone TimeZone(identifier: "Asia/Seoul"), date formatter return wrong year like below (lldb) po print(date); let formatter = DateFormatter(); formatter.timeZone = TimeZone(identifier: "Asia/Seoul"); formatter.dateFormat = "YYYY-MM-dd"; formatter.string(from: date) 2024-12-28 15:00:00 +0000 "2025-12-29" (lldb) po print(date); let formatter = DateFormatter(); formatter.timeZone = .gmt; formatter.dateFormat = "YYYY-MM-dd"; formatter.string(from: date) 2024-12-28 15:00:00 +0000 "2024-12-28"
2
0
499
Jan ’25
Cmake build unable to 'find' Foundation framework
I'm trying to build llama.cpp, a popular tool for running LLMs locally on macos15.1.1 (24B91) Sonoma using cmake but am encountering errors. Here is the stack overflow post regarding the issue: https://stackoverflow.com/questions/79304015/cmake-unable-to-find-foundation-framework-on-macos-15-1-1-24b91?noredirect=1#comment139853319_79304015
0
0
513
Dec ’24
App Settings Not Appearing with Xcode 16.2
I recently encountered an issue with Xcode 16.2 while attempting to integrate Settings.bundle into a new app. I added Settings.bundle as a new file (using the provided template), but when I ran the app (the default "Hello World" project), the expected three default controls (Name, Enabled, Slider) did not appear in the app's settings. To troubleshoot, I downgraded my system to macOS Sonoma 14.7.2 and Xcode 15.4 (on a 2023 Mac Mini, M2). After this downgrade, everything worked as expected. With a new project, adding Settings.bundle, and running the app, the settings entry for the app appeared, including the three default fields. This behavior suggests a potential issue or incompatibility with Xcode 16.2.
3
3
1.2k
Dec ’24
Foundation _userInfoForFileAndLine crash
Could anyone give some insights to identify the root cause for this crash? Fatal Exception: NSInternalInconsistencyException Layout requested for visible navigation bar, <UINavigationBar: 0x120e74280; frame = (0 0; 430 56); autoresize = W; tintColor = <UIDynamicProviderColor: 0x300488b20; provider = <__NSMallocBlock__: 0x300a60900>>; layer = <CALayer: 0x3000f0380>> delegate=0x1277a4600 standardAppearance=0x302d5c770 scrollEdgeAppearance=0x302d5d500, when the top item belongs to a different navigation bar. topItem = <UINavigationItem: 0x10a7d8500> title='Transfers' style=navigator leftBarButtonItems=0x300690020 rightBarButtonItems=0x300613ff0, navigation bar = <UINavigationBar: 0x11a8ef200; frame = (0 0; 430 44); opaque = NO; autoresize = W; layer = <CALayer: 0x3002a44c0>> delegate=0x1277a0c00, possibly from a client attempt to nest wrapped navigation controllers. ==== Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x827cc __exceptionPreprocess 1 libobjc.A.dylib 0x172e4 objc_exception_throw 2 Foundation 0x80f8d8 _userInfoForFileAndLine 3 UIKitCore 0x2b63e8 -[UINavigationBar layoutSubviews] 4 UIKitCore 0xd688 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] 5 UIKitCore 0x14dc14 -[UINavigationBar layoutSublayersOfLayer:] 6 QuartzCore 0x78c28 CA::Layer::layout_if_needed(CA::Transaction*) 7 QuartzCore 0x787b4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) 8 QuartzCore 0xcf914 CA::Context::commit_transaction(CA::Transaction*, double, double*) 9 QuartzCore 0x4e7c4 CA::Transaction::commit() 10 QuartzCore 0x91a0c CA::Transaction::flush_as_runloop_observer(bool) 11 UIKitCore 0xa3568 _UIApplicationFlushCATransaction 12 UIKitCore 0xa0b64 __setupUpdateSequence_block_invoke_2 13 UIKitCore 0xa09d8 _UIUpdateSequenceRun 14 UIKitCore 0xa0628 schedulerStepScheduledMainSection 15 UIKitCore 0xa159c runloopSourceCallback 16 CoreFoundation 0x56328 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 17 CoreFoundation 0x562bc __CFRunLoopDoSource0 18 CoreFoundation 0x53dc0 __CFRunLoopDoSources0 19 CoreFoundation 0x52fbc __CFRunLoopRun 20 CoreFoundation 0x52830 CFRunLoopRunSpecific 21 GraphicsServices 0x11c4 GSEventRunModal 22 UIKitCore 0x3d2eb0 -[UIApplication _run] 23 UIKitCore 0x4815b4 UIApplicationMain 24 XX 0xa0f64 main + 7 (main.m:7) 25 ??? 0x1abb6eec8 (Missing)
1
0
888
Jan ’25
FirstResponderView/FirstResponderIndexPath in TableView
I found when I put a webView on the screen and then remove it, several properties in TableView including firstResponderView, FirstResponderIndexPath, and FirstResponderViewType have changed. These properties are hidden and I cannot change them. firstResponderView strong holds my cell, resulting in my cell not being able to call didEndDisplayCell when it slides out of the screen as expected. What should I do to avoid firstResponderView from strong holding my cell, or what should I do to release it?
1
0
328
Dec ’24
*** -colorSpaceName not valid
Here is a relatively simple code fragment: let attributedQuote: [NSAttributedString.Key: Any] = [ .font: FieldFont!, .foregroundColor: NSColor.red] let strQuote = NSAttributedString.init(string:"Hello World", attributes:attributedQuote) strQuote.draw(in: Rect1) It compiles without an issue, bur when I execute it, I get: "*** -colorSpaceName not valid for the NSColor <NSColor: 0x6000005adfd0>; need to first convert colorspace." I have tried everything I can think of. What's going on?
0
1
342
Jan ’25
How to learn Xcode as a beginner
Hi All, I am from a non tech background and always felt a need that I am missing on the most interesting skills in today's world. I wish to learn Xcode to build applications and much more. Could any of you kindly suggest how I can learn and engage online. Thank You Govind
1
0
413
Dec ’24
Crash SIGABRT and no signs of app code in stack trace
Team, I am seeing following crash with no trace of evidence to reproduce the crash. Any ideas how to reproduce this/ do potential fixes? Application Specific Information: *** Terminating app due to uncaught exception 'b'MACH_EXCEPTION_TYPE: Unknown type:999'', reason: 'b'Unknown Type:999/code:999'' Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00001d9b951d4 0x1d9b89000 + 49620 1 libsystem_c.dylib 0x0000191587ad8 0x191510000 + 490200 2 libc++abi.dylib 0x0000211b0d5b8 0x211afa000 + 79288 3 libc++abi.dylib 0x0000211afbbac 0x211afa000 + 7084 4 libobjc.A.dylib 0x0000186ae6e14 0x186ab4000 + 208404 5 libc++abi.dylib 0x0000211b0c87c 0x211afa000 + 75900 6 libc++abi.dylib 0x0000211b100ac 0x211afa000 + 90284 7 libobjc.A.dylib 0x0000186ae2650 0x186ab4000 + 190032 8 CoreFoundation 0x00001897c8934 0x189776000 + 338228 9 GraphicsServices 0x00001d57a81c4 0x1d57a7000 + 4548 10 UIKitCore 0x000018c32eeb0 0x18bf5c000 + 4009648 11 UIKitCore 0x000018c3dd5b4 0x18bf5c000 + 4724148 12 Chase 0x00001032d98e0 main + 5789920 (main.swift:29) 13 ?-?-? 0x00001af1b6ec8 0x0 + 0
1
0
266
Dec ’24
I need some help, thank you
I ask apple , my identity,com.lgxsgj.xsgj is in company account (Loudi Hualing Yunchuang Shuzhi Technology Co., Ltd) but xcode shows error, xcode shows my profile doesn't incude signing certificate (Loudi Hualing Yunchuang Shuzhi Technology Co., Ltd). but I have other com.lgxsgj.xsgj1,com.lgxsgj.xsgj2, it's correct
1
0
210
Dec ’24