Welcome to the Apple Developer Forums

Post your questions, exchange knowledge, and connect with fellow developers and Apple engineers on a variety of software development topics.

For questions about using Apple hardware and services, visit Apple Support Communities

Posts

Sort by:
Post not yet marked as solved
0 Replies
21 Views
I'm unable to find dyld_info (formerly dyldinfo) in the expected Xcode/Command-line tools. I understand from an 8/12/22 commit message in the swift source tree (which uses it) that dyldinfo was to be renamed to dyld_info per rdar://98570807. I have current XCode 14.0.1 (14A400) and updated command-line tools, but I can't find dyldinfo or dyld_info anywhere. I do find all the other tools mentioned in the docs, so I don't have other reasons to think my install is bad. (I'm on x86_64.) Where is dyld_info normally installed? Can anyone verify it came with the latest XCode? Is there a workaround for me to obtain it? Thanks!
Posted
by
Post not yet marked as solved
0 Replies
14 Views
I'm using NSURLSession et al to download files in my iPhone app. It works correctly except for large (>20MB) files. Then, without exception, the NSURLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite: callback returns -1 for totalBytesExpectedToWrite. Embedded in the NSURLSessionDownloadTask.response object there is an HTTP header dictionary with this key/value pair: "Content-Length" = ( 22268238 ); This is the correct value that I need so I can monitor the download progress, not the "expected value". How can I obtain this header value from the NSURLResponse object? If I access response.expectedContentLength it always returns -1. One would expect a -allHeaderFields method, or perhaps [response headerValueForKey:@"Content-Length"] or some such. Is there a way to obtain the NSURLResponse object's HTTP header values in a NSDictionary?
Posted
by
Post not yet marked as solved
0 Replies
12 Views
Can I use the access token that is received from sign in with Apple to access the Apple music API if I have MusicKit enabled under my app services or is the Music-User-Token a separate token. I cannot use MusicKit as my application is being written in Go.
Posted
by
Post not yet marked as solved
0 Replies
12 Views
I am working on converting an application I wrote for iOS from using UIKit to using SwiftUI. So far, it looks like I’ve been able to get just about everything working with SwiftUI except for one thing. I have a table view that displays several rows of information in a few columns. The table has a single header at the top containing titles for each column. However, there is an aspect of the table view that introduced an undesirable behavior. When scrolling the content, row scrolling upward would appear underneath the header row. The desire was to have the header row be opaque with regard to the table content yet still allow background content underneath the header to show through. In UIKit I ended up implementing a hack of sorts to prevent content of scrolling rows from appearing directly behind  the header. To do this, during scrolling the code was calling the UITableView.rectForHeader method and applying a mask to the layer of any rows that might be intersecting that header rectangle. That mask had a gradient applied to it to make the portion of the row inside the header completely translucent, while allowing the rest of the row to display as normal. In SwiftUI, I have the same issue with the scrolling content appearing underneath the headers, yet am unsure how to prevent that from happening. I don’t know if it would involve using a transparency hack like I did for UIKit, or if there might be some other way to prevent the content from showing up. In any case,I have been unable to find a solution that could provide the desired behavior. What could be done in SwiftUI to allow the table header to be opaque with respect to scrolling table rows?
Posted
by
Post not yet marked as solved
1 Replies
29 Views
I bought an iPhone SE 2nd generation about a week ago renewed from Amazon and the battery health was at 92% and I checked today and it was decreased 3% at 89% I am confused how is the battery rapidly decreasing
Posted
by
Post not yet marked as solved
1 Replies
25 Views
My Finder becomes unresponsive when trying to save a new file. I would create a file and try to save it, and once the Finder asks me to select the location to save the file it "Freezes". The strange thing about this is that my device (a Macbook pro 16" M1) is still responsive and not showing any concerning signs of resource usage. This was very strange because this would happen regardless of which file format (word document or C++ file for example) I would be trying to save. Apple should definitely look into this unless I am an anomaly and it only happens to me :) Having said all of this, I did manage to find ... well more like accidentally discover the solution to this. If I simply just slightly expand the finder window it functions as normal thus fixing all my problems :)
Posted
by
Post not yet marked as solved
0 Replies
43 Views
Hello everyone, I’d like to ask an advice about getting a 13” MacBook. I’m a Flutter developer creating apps for iOS & Android, so the heaviest workload I can imagine will consist of running Xcode and Android Studio while debugging an app (including Simulator and Android Emulator), having Safari with ~20 tabs open while surfing the web, maybe having some other productivity apps open such as Trello, GitHub Desktop, etc. simultaneously. With that in mind, I’m considering getting a machine with 16GB of RAM. Which of the four (M1 Air, M1 Pro, M2 Air, M2 Pro) do you think is enough for my needs? They’re all pretty powerful from my perspective so I’m having a problem at picking one. What’s your recommendation? Or is it that all of them suit my needs and are performant enough, so it’s only a question of relative speed and snappiness? Also, can M1 Pro be more performant than M2 Air in my scenario? Thanks for your answers in advance!
Posted
by
Post not yet marked as solved
1 Replies
36 Views
I have a late 2013 macbook pro with German keyboard layout and Big Sur installed. Recently, I tried to set my firmware password in recovery mode. During recovery mode the German keyboard layout is working, but then when I tried to login again with the firmware password, it did not work. I realised that for the login the German keyboard layout was not working. When I replaced Z with Y in my password in order to adjust to the English layout, the login worked.
Posted
by
Post not yet marked as solved
1 Replies
30 Views
I have a page written in Vue.js and Vite.js, and while I'm scrolling from top to bottom of the page, the theme changes. I thought that fixing linear-gradient CSS (see commit here will fix the issue, however, it didn't. The page source can be found here. This is a specific issue happening only in Safari browser.
Posted
by
Post not yet marked as solved
0 Replies
30 Views
I'm having a problem with Mac Ventura 13 using Xcode 14.1 Delete key issue. When I press delete a pair of single quotes is created. Xcode shows a coding error with the option to fix the problem. Sometimes several sets of double single quotes are created after pressing the Delete key. The error message fix option has been the best way to delete single quotes. I've tried reinstalling Xcode but the issue persists. Any suggestions?
Posted
by
Post not yet marked as solved
0 Replies
40 Views
Hello! I'm using NSPersistentCloudKitContainer for storing data and UICloudSharingController for sharing. Here's how UICloudSharingController is created: func share(_ record: Record, avatar: UIImage) { let controller = shareControllerForRecord(record, avatar: avatar)         controller.delegate = self         controller.popoverPresentationController?.sourceView = self.view         controller.popoverPresentationController?.permittedArrowDirections = []         present(controller, animated: true) }     func shareControllerForRecord(_ record: Record, avatar: UIImage) -> UICloudSharingController {         if let share = share(for: record) {             let controller = UICloudSharingController(share: share, container: self.cloudKitContainer)             return controller         } else {             let controller = UICloudSharingController { [weak self] (controller, completion: @escaping (CKShare?, CKContainer?, Error?) -> Void) in                 guard let self = self else { return }                 self.persistentContainer.share([record], to: nil) { objectIDs, share, container, error in                     if let share = share {                         record.managedObjectContext?.performAndWait {                             share[CKShare.SystemFieldKey.title] = record.title                             share[CKShare.SystemFieldKey.thumbnailImageData] = avatar.pngData()                         }                     }                     completion(share, container, error)                 }             }             return controller         }     } Once UICloudSharingController is created the user do basic stuff, and in most cases sharing works fine. But some users (I can see it in analytics) get this error: Error Domain=_UIShareErrorDomain Code=0 "(null)" UserInfo={NSUnderlyingError=0x28399e340 {Error Domain=CKErrorDomain Code=2 "CKInternalErrorDomain: 1011" UserInfo={ContainerID=iCloud.net.bundleidentifier, NSDebugDescription=CKInternalErrorDomain: 1011, CKPartialErrors={ "<CKRecordID: 0x2837f2280; recordName=cloudkit.zoneshare, zoneID=com.apple.coredata.cloudkit.share.9A2156CD-2E69-4987-966E-AC5A3F593737:__defaultOwner__>" = "<CKError 0x28399d890: \"Unknown Item\" (11/2003); server message = \"recordChangeTag specified, but record not found\"; op = CE76405043B1BE49; uuid = C567647F-331B-4002-9893-2791F38131B3; container ID = \"iCloud.net.bundleidentifier\">"; }, RequestUUID=C567647F-331B-4002-9893-2791F38131B3, NSLocalizedDescription=Failed to modify some records, CKErrorDescription=Failed to modify some records, NSUnderlyingError=0x28399e430 {Error Domain=CKInternalErrorDomain Code=1011 "Failed to modify some records"  ... For me it seems like remote database doesn't have the Record uploaded yet. But it's strange, because these are not newly created records. Besides, for majority of users sharing works. Can anyone advise?
Posted
by
Post not yet marked as solved
0 Replies
44 Views
I have MacOS bundle application which I've signed, packed into dmg and notarized. When I upload and download the dmg, copy the app somewhere, it is rejected by gatekeeper: “my” cannot be opened because the developer cannot be verified. or “check-signature” cannot be opened because it is from an unidentified developer. Tested on Monterey and High Sierra. In past it worked, but my HDD crashed so I had to install OS and whole development environment again so now I'm trying with different xcode version (13.4.1) and some 3rd party c++ libraries are newer, but basically layout of the application is the same and also code signing post build script which calls codesign inside out. In the Contents/MacOS folder my application contains nested bundle app. When I omit that nested bundle and notarize the app, gatekeeper is happy, but I need that nested application. When I verify dmg, or extracted application, there is no problem: spctl -a -t exec -vvv my.app  my.app: accepted source=Notarized Developer ID origin=Developer ID Application: my company (L….) spctl -a -t exec -vvv my.app/Contents/MacOS/nested.app my.app: accepted source=Notarized Developer ID origin=Developer ID Application: my company (L….) codesign --verify --deep --strict -v my.app my.app: valid on disk my.app: satisfies its Designated Requirement I've also tried check-signature tool (ironically it is not notarized) ./check-signature my.app .my.dmg  (c) 2014 Apple Inc. All rights reserved. my.app: YES my.dmg: YES I've also checked the logs, I've found nothing suspicious. Mounting the DMG: assessment granted for my.dmg by Notarized Developer ID com.apple.message.domain: com.apple.security.assessment.outcome2 com.apple.message.signature2: bundle:UNBUNDLED com.apple.message.signature3: my.dmg com.apple.message.signature5: UNKNOWN com.apple.message.signature4: 3 com.apple.message.signature: granted:Notarized Developer ID Some log from finder about opening the app, then this from syspolicyd: assessment granted for .app by Developer ID com.apple.message.domain: com.apple.security.assessment.outcome2 com.apple.message.signature2: bundle:com.my com.apple.message.signature3: .app com.apple.message.signature5: 1.0 com.apple.message.signature4: 1 com.apple.message.signature: granted:Developer ID I've followed advices from other threads from this forum, but I cannot figure out anything. Any idea what else can I do to see what exactly is the problem? Thank you.
Posted
by
Post not yet marked as solved
0 Replies
47 Views
Hi Team, The User Enrollment introduced by Apple back was really great I was trying to test out that .As per the implementation details provided by apple for Simple Authentication - User Enrollment Flow. Below are the steps I followed to implement it. Step 1) Making a /.well-known/com.apple.remotemanagement url and sending a json as for byod which apple has detected successfully. Step 2) Apple making a POST request to BaseServer URL of MDM to get enrollment profile ( At this Step as there is not Authorization header I sent a 401 with WWW-Authenticate header with scheme and url as mentioned by apple) Step 3) Apple has requested With GET to get the html page to show to the user from the url mentioned in WWW-Authenticate header. Step 4) Here there is a tweak the HTML page I actually shown doesn't contains any form as it is for testing purposes. I Simply had a button which upon clicking sends a POST to my url with empty JSON using axios library where from the server I sent a 308 redirect with Location header as mentioned by apple apple-remotemanagement-user-login://authentication-results?access-token=dXNlci1pZGVudGl0eQ Where after I expect the ASWebAuthenticationSession to end and apple to start Second Enrollment attempt with acces token as Authorization Bearer token But the Screen showing the HTML page doesn't go away and neither apple started any steps to get the Enrollment profile from MDM server . Am I commiting any mistakes here.Could you please help on going with it.
Posted
by
Post not yet marked as solved
0 Replies
35 Views
We are developing browser based apps and would like to know if ARDepthData containing LIDAR-based depth information can be obtained from a browser.
Posted
by
Post not yet marked as solved
1 Replies
16 Views
Ho un iPhone 13 con iOS 16.1 RC. Sulle impostazioni, in generale, spazio iPhone noto che lo spazio occupato dalla galleria fotografica è di 1,35 GB. i dati sono sbagliati poiché sono molto di più (almeno 11 GB tra foto e video). Potrebbe essere un bug? Non uso iCloud e le impostazioni su iCloud e Fototeca sono disabilitate.
Posted
by
Post not yet marked as solved
0 Replies
34 Views
I recently installed Safari 16.1 beta 5 and now I'm getting the error "The Webpage was reloaded because a problem occurred" followed up the error message "A problem repeatedly occurred with (URL)" on many web pages. Everything works fine in Chrome, but I prefer Safari. Any suggestions on how to fix this? I tried some of the suggestions on the internet including emptying the cache, clearing web data, and so on, but nothing worked. Thanks for whatever help any of you can advise!
Posted
by
Post not yet marked as solved
1 Replies
53 Views
Hi! I am using the HKAnchoredObjectQuery to first get a snapshot of the initial results, and then trigger an updateHandler. I need to handle the initial results and the updates separately, which is why I implemented two completions. When I test the code, it works for a while. New and deleted samples trigger the updateHandler. However, after a while there appears an error: [connection] nw_read_request_report [C2] Receive failed with error "Software caused connection abort" Followingly, the updateHandler will stop getting triggered when I add updates in Apple health. Anyone have experience with this? func getMostRecentSample(for sampleType: HKSampleType, anchorKey: String, completion: @escaping (HKQuantitySample?, Error?) -> Swift.Void, updateHandler: @escaping (HKQuantitySample, Error?) -> Swift.Void) {     // If it is the first initialization, anchor is passed as nil     var anchor: HKQueryAnchor? = nil // Check for previous saved anchor in userdefaults     if UserDefaults.standard.object(forKey: anchorKey) != nil {       let data = UserDefaults.standard.object(forKey: anchorKey) as! Data       do {         guard let newAnchor = try NSKeyedUnarchiver.unarchivedObject(ofClass: HKQueryAnchor.self, from: data) else {           print("Could not parse anchor to HKQueryAnchor type")           return         }         anchor = newAnchor       } catch {         print("Error retreiving anchor from UserDefaults")       }     }     let query = HKAnchoredObjectQuery(type: sampleType,                      predicate: nil,                      anchor: anchor,                      limit: HKObjectQueryNoLimit                       ) { (query, samplesOrNil, _, newAnchor, errorOrNil) in       guard let samples = samplesOrNil as? [HKQuantitySample] else {         fatalError("*** An error occurred during the initial query: \(errorOrNil!.localizedDescription) ***")       }       if let anchor = newAnchor {         do {           let data = try NSKeyedArchiver.archivedData(withRootObject: anchor as Any, requiringSecureCoding: false)           UserDefaults.standard.set(data, forKey: anchorKey)         } catch {           print("Error retreiving anchor from UserDefaults")         }       }       completion(samples.last, nil)     }           // Setting up long-running query     query.updateHandler = { (query, samplesOrNil, _, newAnchor, errorOrNil) in       guard let samples = samplesOrNil as? [HKQuantitySample] else {         fatalError("*** An error occurred during an update: \(errorOrNil!.localizedDescription) ***")       }       if let anchor = newAnchor {         do {           let data = try NSKeyedArchiver.archivedData(withRootObject: anchor as Any, requiringSecureCoding: false)           UserDefaults.standard.set(data, forKey: anchorKey)         } catch {           print("Error retreiving anchor from UserDefaults")         }       }       if let sample = samples.last {         updateHandler(sample, nil)       }     }     self.healthStore.execute(query)   }
Posted
by
Post not yet marked as solved
0 Replies
25 Views
Hello! Long time ago (I think more than 3 years ago) I've watched apple video about developers "coding at night "and so on 😅 - it was like cinematic movie. I think (as I remember so) the main theme was to say "thank you, developers" I really loved that video and wanted to see it one more time. I was searching for it on YouTube (like for two days 😬) and on Google (videos/photos/news etc.) but without success.. I will be grateful if someone possibly can share me the link, or knows where I can search for it. Greetings, Oskar
Posted
by
Post not yet marked as solved
2 Replies
49 Views
Hi everyone, I am new to xcode and am getting this runtime error when I click on the add button for my application. Any help would go along away, thank you! Error: "Exception NSException * "-[Shopping_List.ListViewController addItems:]: unrecognized selector sent to instance 0x7f8fe6507b50" 0x000060000263b690" override func viewDidLoad() {     super.viewDidLoad()           // Set Title     title = "Items"           // Register Class     tableView.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: CellIdentifier)           // Create Add Button     navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(UIPushBehavior.addItem(_:)))           // Create Edit Button     navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .edit, target: self, action: Selector(("editItems:")))   } // MARK: -   // MARK: Add Item View Controller Delegate Methods   func controller(controller: AddItemViewController, didSaveItemWithName name: String, andPrice price: Float) {     // Create Item     let item = Item(name: name, price: price)           // Add Item to Items     items.append(item)           // Add Row to Table View     tableView.insertRows(at: [IndexPath(row: (items.count - 1), section: 0)], with: .none)          // Save Items     saveItems()   } // MARK: -   // MARK: Actions   func addItem(sender: UIBarButtonItem) {     performSegue(withIdentifier: "AddItemViewController", sender: self)   }       func editItems(sender: UIBarButtonItem) {     tableView.setEditing(!tableView.isEditing, animated: true)   }
Posted
by

Pinned Posts

Categories

See all