cobin/foundation/
ns_mutable_array.rs

1use {
2  std::marker::PhantomData,
3  crate::{
4    obj::Object,
5    PrivateMarker,
6    runtime::NSObjectBase,
7    foundation::NSArrayBase
8  }
9};
10
11pub struct NSMutableArray<T: 'static>(PrivateMarker, PhantomData<T>);
12
13impl<T> Object for NSMutableArray<T> {}
14unsafe impl<T> objc::Message for NSMutableArray<T> {}
15
16impl<T> NSObjectBase for NSMutableArray<T> {
17  fn class_name() -> &'static str { "NSMutableArray" }
18}
19
20impl<T> NSArrayBase<T> for NSMutableArray<T> {}
21
22impl<T> NSMutableArray<T> {
23  pub unsafe fn add_object(&mut self, obj: T) {
24    msg_send![self, addObject:obj]
25  }
26}