Cocoa Programming L91 - NSTableView Big Sur Updates

  Рет қаралды 3,031

AppleProgramming

AppleProgramming

Күн бұрын

Пікірлер: 25
@akashrevanna5327
@akashrevanna5327 3 жыл бұрын
Thanks for these MacOS tutorial series 🙏
@kev_G
@kev_G 3 жыл бұрын
Thanks for going over these updates! Do you happen to know if there updates to NSMenuItem? If you click on the Wi-Fi menubar item you can see a whole host of new objects that can reside in a menu (toggles, headers, interactive items "Other Networks (>)"). Been trying to track down documentation around this. Any pointers would be great!
@AppleProgramming
@AppleProgramming 3 жыл бұрын
I’ll look at the API diffs. I’ll have more updates this week.
@kev_G
@kev_G 3 жыл бұрын
@@AppleProgramming Thanks! I think they are using Swift UI now. Looks like you can have toggles and expandable lists. Maybe its all custom now.
@AppleProgramming
@AppleProgramming 3 жыл бұрын
@@kev_G SwiftUI for menu items? I somewhat doubt that, but maybe it’s just not a true menu item at all. That or SPI.
@AppleProgramming
@AppleProgramming 3 жыл бұрын
@@kev_G So I guess it is SwiftUI for the WiFi menu item. Though a lot of it is possible by using custom views. NSMenuItem allows you to embed a completely custom NSView into it using the `view` property.
@kev_G
@kev_G 3 жыл бұрын
@@AppleProgramming Thanks for taking a look into it! Little bit of a bummer it isn't easily accessible to make something exactly like it but thats ok. :D
@DurangoLegend
@DurangoLegend 3 жыл бұрын
Thank you for all your efforts making these tutorials. There is almost no resource for learning MacOS programming as everything is geared for iOS. Could you please do an in depth tutorial on sending and receiving data via UDP / TCP sockets? I am having a hard time figuring this out and I can't find resources on the web or in books to help. I am wanting to build a simple app to send a command to a device via a udp socket and receive a response from the device. I can get it to work but it is inconsistent and I am having a hard time trying to build functions that return the information because the Network Framework functions all run asynchronous. It is confusing and I am sure you could clear up all the confusion with a tutorial of the whole process. Thanks again, your videos are great.
@AppleProgramming
@AppleProgramming 3 жыл бұрын
I’m not really an expert in UDP/TCP, but I think the Network framework is pretty decent. The question might be more about the device you’re trying to communicate with than the iOS side.
@DurangoLegend
@DurangoLegend 3 жыл бұрын
@@AppleProgramming Thanks for the reply. No, I know how to communicate to the device. My issue is more with the Network.Frameworks. It runs asynchronous in a separate thread. You set up a connection, issue a send request, set up a receive request and start the queue. This works and returns the data I am expecting from the device. But my issue is that I can't figure out how to get this to work with my app interface and functions. Trying to return received data won't work because the functions run and return before the data arrives. It runs asynchronous and it doesn't fill in variables or receive data until the queue works through the commands. This makes it extremely hard to work with. I would like something like a function to makeConnection(), a function to send(Commands: myCommand) and a function like receive() -> String where it returns the received data as a string. Unfortunately this isn't possible as something like receive()-> String will return before the NWConnection ever sends and receives the command and data. I am sure there is a trick to working with this asynchronous queue that I am missing and would appreciate if you could put together a tutorial on how to work with Network.Framework. It might be that there is an easier way or a more direct way.
@AppleProgramming
@AppleProgramming 3 жыл бұрын
@@DurangoLegend Sounds like you’re trying to force it into a more synchronous response when that’s probably not what you want to do. Out of curiosity, what device are you trying to communicate with? Could I setup something similar on my own?
@DurangoLegend
@DurangoLegend 3 жыл бұрын
@@AppleProgramming I am trying to write an app for a Uniden Scanner Radio. It has two ways to communicate to it. Via USB or Via UDP on Port 50536. It has it's own command code that is supplied by Uniden but can be found online. It's pretty simple. I have written several apps using the USB connection but I really want to write one that communicates via UDP and possibly also connect a stream and get audio as well. Right now I am focused on just remote control operations like controlling volume, squelch, hold, avoid, setting date, and writing scanned frequencies to a mirrored display on the Mac. You are right in that I am wanting more of a serial response like I have with a USB connection. The asynchronous nature of using UDP in the Network.Framework is what is throwing me. I can send information from my main ViewController but receiving is more complicated because of the way NWConnection.receive behaves. It is almost like I have to make all of my interface elements like textfields and tables global, I have to do all my parsing etc in the spawned thread, and set those interface values in the if statement for the ready state. It seems really awkward. I just want a receive function that returns the received data directly in the same thread that my view controller is running in. But that doesn't seem like the way it works. I am very confused and it is difficult to explain why without getting into showing you my code and going into more detail than I am sure you want to hear about on this KZbin comment board. I was hoping that maybe you could put together an overview video of how to setup a simple UDP or TCP connection and use it in conjunction with a simple interface, to send and receive data and then store that data in an array that could be manipulated or placed in a tableview. Even if it was a simple browser type app that connected via TCP to port 80 of a website and sent the Get HTTP header and then received and parsed some simple HTML to display in a view. That would be a great help. It is difficult to find any good examples of something like this. I have searched everywhere and I keep coming up empty. Thanks again and I am sorry that I have sidetracked your comment section on the Big Sur TableView video. If you are interested in more info I could send you the Uniden command codes and send you some example code but I would need to send it to you privately.
@try_catch_error
@try_catch_error 3 жыл бұрын
Hello! Thank you for tutorial. Do you know, how update | reload row, if the item is NSManagedObject? Hashable depends on only reference, not property’s of the object. Insert, delete, move work good. Sorry for my English.
@AppleProgramming
@AppleProgramming 3 жыл бұрын
Using an NSFetchedResultsController with the snapshot delegate callback would be your friend here. There is a way to tell if the object has been updated and you can feed those changed identifiers into `reloadItems` on the new snapshot and finally apply it on the data source.
@try_catch_error
@try_catch_error 3 жыл бұрын
@@AppleProgramming Yes, i do that! I manualy reload row in the delegate method. But i cant use controllerDidChange with snapshot, because data has difficult condition to group it to sections. Also i cant sort by transient property in Core Data :( I apply my new snapshot (calculate manualy) in controllerDidChange delegate method. And row actions, drag and drop dont work too with diffable data source (May be I must create subclass of the NSTableViewDiffableDataSource) . It is very saddenly.
@vjaynr
@vjaynr 3 жыл бұрын
This channel is a gem. Can you make a tutorial on NSFileProvider on macOS?
@AppleProgramming
@AppleProgramming 3 жыл бұрын
Which part specifically? You're describing a whole host of classes. What are you trying to accomplish?
@vjaynr
@vjaynr 3 жыл бұрын
@@AppleProgramming I basically want to make a Dropbox like application, that would talk to my cloud storage ,enumerate and list the contents on the cloud in the Finder. It's possible to accomplish this in iOS with Files app. But it looks like the macOS counterpart introduced now... which lacks doc support not any working samples ..
@vjaynr
@vjaynr 3 жыл бұрын
developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension
@AppleProgramming
@AppleProgramming 3 жыл бұрын
@@vjaynr Hmm okay. I haven’t looked into any of these classes as they are new to macOS but I can see what I can gather.
@vjaynr
@vjaynr 3 жыл бұрын
@@AppleProgramming Thank you :)
@KodeThamizhan0511
@KodeThamizhan0511 3 жыл бұрын
Bro is that Not working For without storyboard? how can i do with programtic way please helpme
@AppleProgramming
@AppleProgramming 3 жыл бұрын
This example uses a xib file (not a storyboard). NSTableView construction is quite lengthy without Interface Builder. You have to create an NSScrollView and embed the NSTableView inside of that.
@KodeThamizhan0511
@KodeThamizhan0511 3 жыл бұрын
@@AppleProgramming Yeh bro! but i want to use without Xib, I tried it with code construction , but not working, snapshot apply method doesnt call the escaping cell closure👍please help me to sort this
Cocoa Programming L92 - SF Symbols
8:35
AppleProgramming
Рет қаралды 856
Cocoa Programming L90 - Custom Search Suggestions Window
27:00
AppleProgramming
Рет қаралды 1,1 М.
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 64 МЛН
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 8 МЛН
When mom gets home, but you're in rollerblades.
00:40
Daniel LaBelle
Рет қаралды 154 МЛН
Cocoa Programming L95 - Multicolumn NSTableView
14:16
AppleProgramming
Рет қаралды 2,7 М.
DispatchWorkItem
12:15
AppleProgramming
Рет қаралды 2,4 М.
Cocoa Programming L93 - Big Sur Window & Toolbar
6:21
AppleProgramming
Рет қаралды 1,6 М.
Cocoa Programming L87 - NSFilePromiseProvider
14:00
AppleProgramming
Рет қаралды 866
Cocoa Programming L89 - Keychain Access
16:21
AppleProgramming
Рет қаралды 1,6 М.
Cocoa Programming L88 - Touch ID Authentication
7:56
AppleProgramming
Рет қаралды 870
Cocoa Programming L94 - @Invalidating
12:57
AppleProgramming
Рет қаралды 2,6 М.
Apple is wrong!  Most people DO NOT need a new Mac!
11:39
Reboot Retro
Рет қаралды 174
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 64 МЛН