comparison ios/dw.m @ 2389:7b06fc7c8130

iOS: Remove some legacy code from macOS 10.5 by swithing to using NSPointerArray method pointerArrayWithOptions: with the option NSPointerFunctionsOpaqueMemory, so we don't mess with the user memory pointers.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 23 Mar 2021 23:14:13 +0000
parents d84cd4227b21
children 2613d1533f1a
comparison
equal deleted inserted replaced
2388:d84cd4227b21 2389:7b06fc7c8130
1723 } 1723 }
1724 lastAddPoint = 0; 1724 lastAddPoint = 0;
1725 } 1725 }
1726 -(void)setup 1726 -(void)setup
1727 { 1727 {
1728 SEL swopa = NSSelectorFromString(@"pointerArrayWithWeakObjects"); 1728 titles = [[NSPointerArray pointerArrayWithOptions:NSPointerFunctionsOpaqueMemory] retain];
1729 1729 rowdatas = [[NSPointerArray pointerArrayWithOptions:NSPointerFunctionsOpaqueMemory] retain];
1730 if(![[NSPointerArray class] respondsToSelector:swopa])
1731 swopa = NSSelectorFromString(@"weakObjectsPointerArray");
1732 if(![[NSPointerArray class] respondsToSelector:swopa])
1733 return;
1734
1735 DWIMP iwopa = (DWIMP)[[NSPointerArray class] methodForSelector:swopa];
1736
1737 titles = iwopa([NSPointerArray class], swopa);
1738 [titles retain];
1739 rowdatas = iwopa([NSPointerArray class], swopa);
1740 [rowdatas retain];
1741 tvcols = [[[NSMutableArray alloc] init] retain]; 1730 tvcols = [[[NSMutableArray alloc] init] retain];
1742 data = [[[NSMutableArray alloc] init] retain]; 1731 data = [[[NSMutableArray alloc] init] retain];
1743 types = [[[NSMutableArray alloc] init] retain]; 1732 types = [[[NSMutableArray alloc] init] retain];
1744 if(!dw_oddcolor && !dw_evencolor) 1733 if(!dw_oddcolor && !dw_evencolor)
1745 dw_oddcolor = dw_evencolor = DW_CLR_DEFAULT; 1734 dw_oddcolor = dw_evencolor = DW_CLR_DEFAULT;