Post

Replies

Boosts

Views

Activity

Reply to Number of item in a NSArrayCollection
So, did you try: let controller = NSArrayController() // add objects         controller.addObject(125 as Any)         controller.addObject("Hello" as Any) print((controller.arrangedObjects as! [AnyObject]).count). // as! [AnyObject] needed because not an array. You get 2. See interesting discussion here: https://stackoverflow.com/questions/30965208/how-to-iterate-over-an-nsarraycontroller-contents-in-swift If OK, don't forget to close the thread by marking correct answer ; otherwise explain what is not working. And please also close or respond on some other threads you opened.
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’21
Reply to Number of item in a NSArrayCollection
Great. Note that if you just add, the count is 0. Because it does not add to the array. That's a pretty subtile difference. func add(Any?) Creates and adds a new object to the receiver’s content and arranged objects. func addObject(Any) Adds object to the receiver’s content collection and the arranged objects array.
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’21
Reply to Toggling between two date Pickers in a table view?
I do not see in your code where is tableView(cellForRow) ?     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { . The simplest would be to manage all this with your dataSource. var pickers : [DatePicker] = [] In your code, you would have pickers = [checkInDatePicker] or pickers = [checkOutDatePicker] Note a question: why do you need to define isCheckOutDatePickerVisible and not use simply isCheckOutDatePicker.isHidden For instance,         } else if indexPath == checkOutDateLabelCellIndexPath && isCheckInDatePickerVisible == false { would become         } else if indexPath == checkOutDateLabelCellIndexPath && icheckInDatePicker.isHidden { Or             isCheckInDatePickerVisible.toggle() would become             checkInDatePicker.isHidden.toggle() That could simplify code a lot. Now a hint. Why do you:         tableView.beginUpdates()         tableView.endUpdates() with nothing inside And not simply tableView.reload()
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’21
Reply to Failed to prepare device for development.
What is the exact message ? Failed of busy ? With a similar problem, I found initial advice here: https://stackoverflow.com/questions/46316373/fixing-xcode-9-issue-iphone-is-busy-preparing-debugger-support-for-iphone To solve the problem, I rebooted everything. When opening Windows > Devices, iPhone was stated as busy. After 10’, that was cleared.
Nov ’21
Reply to How to create navigationController programmatically
You will find details here: https://stackoverflow.com/questions/21609921/how-to-add-navigation-controller-programmatically/36203448 . I don't want to do it with Storyboard It is much easier to do it in storyboard ! sometimes I delete some UI elements some files still keep the deleted elements Probably because you do not delete in the right way. And you should also do a Clean Build Folder after deleting.
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’21
Reply to Number of item in a NSArrayCollection
All in the title except : what is an NSArrayCollection ? I suppose you mean : number of objects managed by NSArrayController ? If so, you could: let controller = NSArrayController() // add objects print((controller.arrangedObjects as! [AnyObject]).count)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Number of item in a NSArrayCollection
So, did you try: let controller = NSArrayController() // add objects         controller.addObject(125 as Any)         controller.addObject("Hello" as Any) print((controller.arrangedObjects as! [AnyObject]).count). // as! [AnyObject] needed because not an array. You get 2. See interesting discussion here: https://stackoverflow.com/questions/30965208/how-to-iterate-over-an-nsarraycontroller-contents-in-swift If OK, don't forget to close the thread by marking correct answer ; otherwise explain what is not working. And please also close or respond on some other threads you opened.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Number of item in a NSArrayCollection
Great. Note that if you just add, the count is 0. Because it does not add to the array. That's a pretty subtile difference. func add(Any?) Creates and adds a new object to the receiver’s content and arranged objects. func addObject(Any) Adds object to the receiver’s content collection and the arranged objects array.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to how can i have separate thresholds for different apps i selected?
What threshold are you speaking about ? A threshold in Appstore Connect ?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to What’s the name of the function.
Though i don’t know the name of the function im after, so i don’t really know how to build my code. Plus what robnotyou said. So do you know anything about what you are looking for ? Otherwise, that will be a difficult search, isn't it ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Android custom catalog match
iOS works as expected. Good news (no surprise). Android questions are not for this forum. You should ask on Android forum.
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Developing a School bus app . Poss competition?
This long text, without a single line break is so hard to read that I could not get past the third line. So, what is your precise question ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to SegmentedControl do not work correctly on iPhone 13Mini simulator
I tested on Xcode 13.2ß. Problem solved. Both on iOS 15.0 and iOS 15.2. So apparently problem was in Xcode.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Toggling between two date Pickers in a table view?
I do not see in your code where is tableView(cellForRow) ?     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { . The simplest would be to manage all this with your dataSource. var pickers : [DatePicker] = [] In your code, you would have pickers = [checkInDatePicker] or pickers = [checkOutDatePicker] Note a question: why do you need to define isCheckOutDatePickerVisible and not use simply isCheckOutDatePicker.isHidden For instance,         } else if indexPath == checkOutDateLabelCellIndexPath && isCheckInDatePickerVisible == false { would become         } else if indexPath == checkOutDateLabelCellIndexPath && icheckInDatePicker.isHidden { Or             isCheckInDatePickerVisible.toggle() would become             checkInDatePicker.isHidden.toggle() That could simplify code a lot. Now a hint. Why do you:         tableView.beginUpdates()         tableView.endUpdates() with nothing inside And not simply tableView.reload()
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to SafeArea breaks after device orientation change
Is it on device or on simulator ? Which versions of Xcode (13 or 13.1 or 13.2), iOS ? Could you show the code you use to get the size ? Where do you run it ? In viewDidLoad ? Or elsewhere ?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Apple, surely it is possible to block some of these these spam posts?
There are effectively a few spams which are repeated ; upsofar, only solution seems to mark as spam. Unfortunately, I wonder if the best solution wouldn't be to restrict forum posting to those with an account (paid ?) and terminate those who spam like this.
Replies
Boosts
Views
Activity
Nov ’21
Reply to which iOS versions are not supported anymore?
What do you mean exactly by "supported" ?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Problem with NavigationLink
Could you post the complete code ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Failed to prepare device for development.
What is the exact message ? Failed of busy ? With a similar problem, I found initial advice here: https://stackoverflow.com/questions/46316373/fixing-xcode-9-issue-iphone-is-busy-preparing-debugger-support-for-iphone To solve the problem, I rebooted everything. When opening Windows > Devices, iPhone was stated as busy. After 10’, that was cleared.
Replies
Boosts
Views
Activity
Nov ’21
Reply to How to create navigationController programmatically
You will find details here: https://stackoverflow.com/questions/21609921/how-to-add-navigation-controller-programmatically/36203448 . I don't want to do it with Storyboard It is much easier to do it in storyboard ! sometimes I delete some UI elements some files still keep the deleted elements Probably because you do not delete in the right way. And you should also do a Clean Build Folder after deleting.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’21