If using cmake, remove the cmake generated temporary files / directories. Then rerun the cmake command and then run the build command (either make or ninja).
Post
Replies
Boosts
Views
Activity
Get the time zone of the location and use that:
import Foundation
let sanFrancisco = TimeZone(identifier: "PST")
let time = Date.now
let timeFormatter = DateFormatter()
timeFormatter.dateStyle = .none
timeFormatter.timeStyle = .short
timeFormatter.timeZone = sanFrancisco
timeFormatter.locale = .current
let timeStr = timeFormatter.string(from: time)
print("\(timeStr)")
// For me, prints 2.08, local time was 12.08.
And, if starting from a coordinate, rather than a timezone identifier:
import Foundation
import CoreLocation
let sanFrancisco = CLLocation(latitude: 37.77493, longitude: -122.41942)
let geoCoder = CLGeocoder()
do {
let placemarks = try await geoCoder.reverseGeocodeLocation(sanFrancisco)
if !placemarks.isEmpty {
if let placemark = placemarks.first {
let time = Date.now
let timeFormatter = DateFormatter()
timeFormatter.dateStyle = .none
timeFormatter.timeStyle = .short
timeFormatter.timeZone = placemark.timeZone
timeFormatter.locale = .current
let timeStr = timeFormatter.string(from: time)
print("\(timeStr)")
} else {
print("No placemark for the coordinate")
}
}
} catch {
print("Failed to geolocate coordinate: \(error.localizedDescription)")
}
Which editors? Some editors have a setting you can use switch ligatures on or off.
Alternatively, use a font that does not have ligatures.
You specify the sound to play:
let chimesSoundEffect = "Chimes-sound-effect.mp3"
But then use a different one when loading the sound file:
guard let url = Bundle.main.url(forResource: "sound", withExtension: "mp3") else { return }
Should you use the one you specify in the variable (without the extensions since you provide it as withExtension parameter):
let chimesSoundEffect = "Chimes-sound-effect"
...
guard let url = Bundle.main.url(forResource: chimesSoundEffect, withExtension: "mp3") else { return }
Hard to say otherwise what could be the issue. If you'd like someone else to test and help out getting this to work, I'd say put this in GitHub as a public repository and let others contribute there. It would be lots of work for others to create an empty project to test out this code of yours there, including putting mp3 files in resources of the app. And if the issue is elsewhere in your project (like where the mp3 file is located), seeing this code only may not be enough to solve your issues.
Maybe using several ModelConfiguration objects and specifying a CloudKit container identifier for those:
https://developer.apple.com/documentation/swiftdata/modelconfiguration/init(_:schema:url:readonly:cloudkitcontaineridentifier:)
The only time my app had duplicate toolbar buttons was when the toolbar extension was attached inside an element in a List. When I moved the toolbar up in the view hierarchy, that fixed it. But this is just guessing without seeing any code of yours, and my app is SwiftUI.
Beta versions include debugging, analytics and testing versions of code / data and logs. So I would expect them to be considerably larger than final released versions.
OK, so what I can do is:
Create two widget targets, one for iOS and one for macOS.
In the app target General settings, scroll to Frameworks, Libraries and Embedded Content.
Select, in the Filters section, for each of the extensions, on which platform they should be embedded to, one for each.
That should do it.
Having the same problem, anyone has anything new to help solve the issue?
I have a NavigationSplitView with three columns and a .searchable()on the first column List view. Data to the views come from Core Data @FetchRequest. Whenever user removes a character from the search field or clears the search field, the same warning is displayed. When entering search text, warning does not appear.
This does not happen always. For example when I enter a search text resulting in one row, and then remove one letter from search text. Then three rows are displayed and this warning does not appear. After removing another letter, resulting to five rows appearing, then this warning appears.
Relevant parts of code below.
struct ContentView: View {
@Environment(\.managedObjectContext) var moc
@FetchRequest (sortDescriptors: [SortDescriptor(\.subject)]) private var categories: FetchedResults<Category>
@State private var selectedCategory : Category? = nil
@State private var selectedTerm: Term? = nil
@State private var searchText = ""
var body: some View {
NavigationSplitView {
List(selection: $selectedCategory) {
ForEach(categories, id: \.self) { category in
CategoryRowView(category: category)
.swipeActions(edge: .trailing) {
Button(role: .destructive) {
toDeleteCategory = category
showDeleteCategoryConfirmation.toggle()
} label: {
Label("Delete", systemImage: "trash")
}
}
}
}
.listStyle(.sidebar)
.searchable(text: $searchText)
...
} content: {
if let category = selectedCategory {
List(category.viewTerms(filter: searchText.isEmpty ? nil : searchText), id: \.self, selection: $selectedTerm) { term in
and the implementation of category.viewTerms(filter: ) that does the filtering based on searchText (Category is a Core Data class):
extension Category {
...
func viewTerms(filter: String?) -> [Term] {
var terms = viewTerms
if filter != nil {
terms = terms.filter( { $0.termSearchText.localizedCaseInsensitiveContains(filter!) } )
}
return terms
}
var viewTerms: [Term] {
let terms = categoryTerms?.allObjects as? [Term] ?? []
return terms.sorted(by: {$0.viewPrimaryName < $1.viewPrimaryName } )
}
Where the Category.categoryTerms is a one-to-many Core Data relationship from Category entity to Term entity.
Should this...:
fmResultSet = ...
...be:
let fmResultSet = ...
..instead? And apparently:
while fmResultSet!.next() == true
Is not the valid way since next() returns the next result object, not a boolean value true or false. So perhaps you need to replace that with:
while fmResultSet!.next() != nil
Later you use the isEmpty property, and that is either true or false but you compare that to nil instead.
Does this help? https://stackoverflow.com/questions/35006614/what-does-symbol-not-found-expected-in-flat-namespace-actually-mean
Could you show two actual date values that cause the issue to appear?
If he sent the code, those are just text files and you can view them with any text editor. Unless he used Interface Builder, in that case it would be a bit inconvenient to view the GUI files.
If you wish to test the app, why doesn't the developer send you the app he build that runs on your environment?
If you complain about how Outlook works, you should go complain in Microsoft forums since they develop it. Not Apple.
If you complain about Apple developed software from the user perspective, then you should go complaining to user support forums, not developer forums.
If you need several data items in a database table (as array in your case), the usual solution is to have two tables with a one-to-many relation to the other table having the multiple values.
In Xcode core data modelling terms, you'd have two entities and a one-to-many relationship between them.
Alternatively, you could do this in code, storing e.g. a comma separated string of elements in a string attribute. But then you'd have to implement parsing and generating this string yourself in code.