Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  mvc.md  Sprache: unbekannt

 
Spracherkennung für: .md vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

# The Model-View-Controller design pattern

The [Model-View-Controller (MVC) design pattern][mvc-doc] is quite prominent in Cocoa application development, and you may end up needing to incorporate parts of it in your application. You can use the following as a rough guideline for how to do so.

**Model**: Use plain Rust structures inside [`Cell<T>`] or [`RefCell<T>`] so that you can mutate them behind shared references (or possibly `Rc<RefCell<T>>`, depending on if you need to share data between multiple controllers).

**View**: Use the built-in views (`NSView` or `UIView`). If you need to register a delegate on these, use the controller as the delegate.

**Controller**: Use the [`define_class!`] macro to create a new object. Use [`MainThreadOnly`] as the [`ClassType::ThreadKind`], so that you can implement view delegate protocols.

[mvc-doc]: https://developer.apple.com/library/archive/documentation/General/Conceptual/CocoaEncyclopedia/Model-View-Controller/Model-View-Controller.html
[`Cell<T>`]: core::cell::Cell
[`RefCell<T>`]: core::cell::RefCell
[`define_class!`]: crate::define_class
[`MainThreadOnly`]: crate::MainThreadOnly
[`ClassType::ThreadKind`]: crate::ClassType::ThreadKind

[Dauer der Verarbeitung: 0.13 Sekunden, vorverarbeitet 2026-10-03]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126864
#Domains=1897691