BlueSolrac BlueSolrac - 4 months ago 7
Objective-C Question

iOS reduce extremely long compile time for class with many 2D arrays

I have a data heavy class that is a property of the app delegate. I haven't experienced any noticeable delay while using the app, however, compiling for release (optimizer on) takes 4+ hours (I've confirmed it's this class that the compiler is stuck on). I have checked the static analyzer and instruments and have not found any issues.

I'm assuming the issue lies with the 20+ 2D arrays (although not sure why as they aren't that big). I was considering moving the 2D array data into a Plist but I'm not sure if this would make a difference?

#import <Foundation/Foundation.h>
#import "Materials.h"
#import "Material_Chart.h"

@interface Materials()
@property(nonatomic, strong) NSMutableArray<Material_Chart *> *materials;
@end

@implementation Materials
-(id)init {
self = [super init];
if(self) {
_materials = [[NSMutableArray alloc] init];
[self setUpMaterials];
}
return self;
}

-(void)setUpMaterials {

Material_Chart *chart;

// Chart 1
chart = [[Material_Chart alloc] init];
chart.sidesSupported = @4;
chart.laminationType = @"Monolithic";
chart.thickness = [[Material_Thickness alloc] initWithNames:@"3/32 in." and:@"2.5 mm" andThickness:@2.16];
chart.thicknessLongDuration = [[Material_Thickness alloc] initWithNames:@"3/32 in." and:@"2.5 mm" andThickness:@2.16];
chart.NFLData = @[@[@-1, @1, @1.25, @1.5, @1.75, @2, @2.25, @2.5, @2.75, @3, @3.25, @3.5, @3.75, @4, @4.5, @5, @5.5, @6, @6.5, @7, @7.5, @8, @8.5, @9, @9.5, @10],
@[@0.25, @2336, @2619, @2888, @3144, @3388, @3629, @3857, @4081, @4289, @4479, @4636, @4726, @4691, @4361, @4377, @4574, @4845, @5150, @5475, @5811, @6154, @6499, @6846, @7194, @7541],
@[@0.5, @1621, @1817, @2004, @2182, @2351, @2512, @2656, @2775, @2834, @2784, @2669, @2627, @2657, @2811, @3021, @3257, @3504, @3758, @4016, @4275, @4534, @4792, @5050, @5307, @5563],
@[@0.75, @1308, @1466, @1616, @1757, @1888, @2003, @2083, @2090, @2013, @1968, @1988, @2044, @2119, @2299, @2499, @2710, @2925, @3143, @3360, @3578, @3795, @4011, @4227, @4442, @4656],
@[@1, @1121, @1257, @1384, @1502, @1605, @1679, @1687, @1630, @1605, @1632, @1687, @1757, @1836, @2010, @2195, @2384, @2577, @2769, @2962, @3154, @3345, @3536, @3726, @3915, @4104],
@[@1.25, @993, @1113, @1225, @1325, @1403, @1434, @1396, @1372, @1391, @1440, @1502, @1574, @1651, @1816, @1987, @2161, @2336, @2511, @2686, @2860, @3033, @3206, @3378, @3550, @3722],
@[@1.5, @899, @1007, @1106, @1191, @1244, @1237, @1211, @1214, @1253, @1308, @1373, @1443, @1518, @1673, @1833, @1994, @2156, @2318, @2479, @2640, @2800, @2960, @3119, @3277, @3436],
@[@2, @766, @857, @936, @992, @1000, @990, @992, @1025, @1077, @1135, @1197, @1264, @1332, @1472, @1614, @1757, @1900, @2043, @2185, @2327, @2468, @2609, @2749, @2889, @3029],
@[@2.5, @674, @752, @815, @845, @845, @845, @870, @912, @964, @1020, @1080, @1142, @1205, @1334, @1463, @1593, @1723, @1852, @1981, @2110, @2238, @2366, @2493, @2620, @2747],
@[@3, @605, @673, @721, @733, @739, @753, @786, @830, @883, @938, @994, @1052, @1111, @1231, @1351, @1471, @1591, @1710, @1829, @1948, @2066, @2184, @2302, @2419, @2536],
@[@4, @505, @558, @584, @596, @613, @637, @682, @725, @773, @823, @874, @926, @979, @1085, @1191, @1297, @1402, @1508, @1613, @1718, @1822, @1926, @2030, @2133, @2236],
@[@5, @435, @476, @498, @515, @541, @567, @611, @654, @699, @745, @792, @839, @887, @983, @1080, @1176, @1272, @1367, @1463, @1558, @1652, @1747, @1841, @1935, @2028],
@[@7, @343, @377, @400, @425, @449, @487, @524, @562, @602, @642, @683, @724, @765, @849, @932, @1015, @1098, @1180, @1262, @1344, @1426, @1508, @1589, @1670, @1750],
@[@10, @275, @304, @329, @350, @382, @413, @446, @479, @514, @549, @584, @619, @655, @726, @797, @868, @939, @1010, @1080, @1150, @1220, @1290, @1359, @1428, @1498]];
chart.deflectionCoefficient = nil;
chart.deflectionData = nil;
chart.deflectionLoadData = nil;
[self.materials addObject:chart];

// Chart 2
chart = [[Material_Chart alloc] init];
chart.sidesSupported = @4;
chart.laminationType = @"Monolithic";
chart.thickness = [[Material_Thickness alloc] initWithNames:@"Lami" and:@"2.7 mm" andThickness:@2.59];
chart.thicknessLongDuration = [[Material_Thickness alloc] initWithNames:@"Lami" and:@"2.7 mm" andThickness:@2.59];
chart.NFLData = @[@[@-1, @1, @1.25, @1.5, @1.75, @2, @2.25, @2.5, @2.75, @3, @3.25, @3.5, @3.75, @4, @4.5, @5, @5.5, @6, @6.5, @7, @7.5, @8, @8.5, @9, @9.5, @10],
@[@0.25, @2672, @3016, @3320, @3614, @3933, @4212, @4474, @4732, @4965, @5169, @5315, @5341, @5185, @4906, @5033, @5309, @5647, @6019, @6408, @6807, @7213, @7620, @8028, @8437, @8844],
@[@0.5, @1871, @2112, @2325, @2531, @2726, @2908, @3065, @3180, @3194, @3082, @2987, @2993, @3058, @3267, @3527, @3810, @4105, @4405, @4710, @5014, @5317, @5621, @5923, @6224, @6524],
@[@0.75, @1516, @1699, @1873, @2035, @2183, @2306, @2371, @2330, @2246, @2238, @2289, @2368, @2465, @2685, @2925, @3176, @3429, @3685, @3941, @4196, @4451, @4704, @4957, @5209, @5461],
@[@1, @1298, @1455, @1602, @1736, @1848, @1912, @1883, @1829, @1832, @1882, @1958, @2045, @2143, @2352, @2571, @2795, @3021, @3248, @3474, @3699, @3923, @4147, @4370, @4592, @4814],
@[@1.25, @1150, @1288, @1416, @1527, @1604, @1610, @1569, @1562, @1603, @1669, @1750, @1838, @1931, @2127, @2328, @2534, @2739, @2945, @3150, @3354, @3557, @3760, @3962, @4164, @4365],
@[@1.5, @1040, @1164, @1276, @1367, @1410, @1383, @1371, @1395, @1452, @1522, @1602, @1688, @1776, @1960, @2148, @2338, @2528, @2718, @2907, @3096, @3283, @3471, @3658, @3844, @4030],
@[@2, @884, @988, @1075, @1126, @1122, @1120, @1141, @1189, @1254, @1323, @1400, @1479, @1559, @1725, @1893, @2061, @2228, @2396, @2563, @2729, @2894, @3060, @3224, @3389, @3553],
@[@2.5, @776, @865, @930, @951, @957, @963, @1006, @1061, @1125, @1192, @1264, @1337, @1412, @1563, @1716, @1868, @2021, @2173, @2324, @2475, @2625, @2775, @2924, @3073, @3222],
@[@3, @694, @771, @818, @831, @842, @869, @913, @968, @1031, @1097, @1164, @1233, @1303, @1443, @1584, @1725, @1866, @2006, @2146, @2285, @2423, @2562, @2700, @2838, @2975],
@[@4, @577, @634, @666, @680, @707, @737, @794, @848, @905, @964, @1025, @1086, @1148, @1272, @1396, @1521, @1645, @1768, @1892, @2015, @2137, @2259, @2381, @2502, @2623],
@[@5, @498, @543, @565, @593, @627, @669, @715, @766, @819, @873, @928, @984, @1040, @1153, @1266, @1379, @1492, @1604, @1716, @1827, @1938, @2049, @2159, @2269, @2379],
@[@7, @392, @431, @462, @494, @530, @569, @613, @658, @705, @753, @801, @849, @898, @995, @1093, @1190, @1287, @1384, @1481, @1577, @1673, @1768, @1864, @1958, @2053],
@[@10, @317, @351, @382, @414, @447, @484, @522, @562, @602, @643, @685, @726, @768, @851, @935, @1018, @1101, @1184, @1267, @1349, @1431, @1513, @1594, @1676, @1757]];
chart.deflectionCoefficient = nil;
chart.deflectionData = nil;
chart.deflectionLoadData = nil;
[self.materials addObject:chart];

...
// Add 20 more charts
...
}

Answer

So I solved the issue by replacing the literals with the NSArray and NSNumber class methods:

        // Chart 1
        chart = [[Material_Chart alloc] init];
        chart.sidesSupported = @4;
        chart.laminationType = @"Monolithic";
        chart.thickness = [[Material_Thickness alloc] initWithNames:@"3/32 in." and:@"2.5 mm" andThickness:[NSNumber numberWithDouble: 2.16]];
        chart.thicknessLongDuration = [[Material_Thickness alloc] initWithNames:@"3/32 in." and:@"2.5 mm" andThickness:[NSNumber numberWithDouble: 2.16]];
        chart.NFLData = [[NSArray alloc] initWithObjects:[[NSArray alloc] initWithObjects:@-1, [NSNumber numberWithDouble: 1], [NSNumber numberWithDouble: 1.25], [NSNumber numberWithDouble: 1.5], [NSNumber numberWithDouble: 1.75], [NSNumber numberWithDouble: 2], [NSNumber numberWithDouble: 2.25], [NSNumber numberWithDouble: 2.5], [NSNumber numberWithDouble: 2.75], [NSNumber numberWithDouble: 3], [NSNumber numberWithDouble: 3.25], [NSNumber numberWithDouble: 3.5], [NSNumber numberWithDouble: 3.75], [NSNumber numberWithDouble: 4], [NSNumber numberWithDouble: 4.5], [NSNumber numberWithDouble: 5], [NSNumber numberWithDouble: 5.5], [NSNumber numberWithDouble: 6], [NSNumber numberWithDouble: 6.5], [NSNumber numberWithDouble: 7], [NSNumber numberWithDouble: 7.5], [NSNumber numberWithDouble: 8], [NSNumber numberWithDouble: 8.5], [NSNumber numberWithDouble: 9], [NSNumber numberWithDouble: 9.5], [NSNumber numberWithDouble: 10], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 0.25], [NSNumber numberWithDouble: 2336], [NSNumber numberWithDouble: 2619], [NSNumber numberWithDouble: 2888], [NSNumber numberWithDouble: 3144], [NSNumber numberWithDouble: 3388], [NSNumber numberWithDouble: 3629], [NSNumber numberWithDouble: 3857], [NSNumber numberWithDouble: 4081], [NSNumber numberWithDouble: 4289], [NSNumber numberWithDouble: 4479], [NSNumber numberWithDouble: 4636], [NSNumber numberWithDouble: 4726], [NSNumber numberWithDouble: 4691], [NSNumber numberWithDouble: 4361], [NSNumber numberWithDouble: 4377], [NSNumber numberWithDouble: 4574], [NSNumber numberWithDouble: 4845], [NSNumber numberWithDouble: 5150], [NSNumber numberWithDouble: 5475], [NSNumber numberWithDouble: 5811], [NSNumber numberWithDouble: 6154], [NSNumber numberWithDouble: 6499], [NSNumber numberWithDouble: 6846], [NSNumber numberWithDouble: 7194], [NSNumber numberWithDouble: 7541], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 0.5], [NSNumber numberWithDouble: 1621], [NSNumber numberWithDouble: 1817], [NSNumber numberWithDouble: 2004], [NSNumber numberWithDouble: 2182], [NSNumber numberWithDouble: 2351], [NSNumber numberWithDouble: 2512], [NSNumber numberWithDouble: 2656], [NSNumber numberWithDouble: 2775], [NSNumber numberWithDouble: 2834], [NSNumber numberWithDouble: 2784], [NSNumber numberWithDouble: 2669], [NSNumber numberWithDouble: 2627], [NSNumber numberWithDouble: 2657], [NSNumber numberWithDouble: 2811], [NSNumber numberWithDouble: 3021], [NSNumber numberWithDouble: 3257], [NSNumber numberWithDouble: 3504], [NSNumber numberWithDouble: 3758], [NSNumber numberWithDouble: 4016], [NSNumber numberWithDouble: 4275], [NSNumber numberWithDouble: 4534], [NSNumber numberWithDouble: 4792], [NSNumber numberWithDouble: 5050], [NSNumber numberWithDouble: 5307], [NSNumber numberWithDouble: 5563], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 0.75], [NSNumber numberWithDouble: 1308], [NSNumber numberWithDouble: 1466], [NSNumber numberWithDouble: 1616], [NSNumber numberWithDouble: 1757], [NSNumber numberWithDouble: 1888], [NSNumber numberWithDouble: 2003], [NSNumber numberWithDouble: 2083], [NSNumber numberWithDouble: 2090], [NSNumber numberWithDouble: 2013], [NSNumber numberWithDouble: 1968], [NSNumber numberWithDouble: 1988], [NSNumber numberWithDouble: 2044], [NSNumber numberWithDouble: 2119], [NSNumber numberWithDouble: 2299], [NSNumber numberWithDouble: 2499], [NSNumber numberWithDouble: 2710], [NSNumber numberWithDouble: 2925], [NSNumber numberWithDouble: 3143], [NSNumber numberWithDouble: 3360], [NSNumber numberWithDouble: 3578], [NSNumber numberWithDouble: 3795], [NSNumber numberWithDouble: 4011], [NSNumber numberWithDouble: 4227], [NSNumber numberWithDouble: 4442], [NSNumber numberWithDouble: 4656], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 1], [NSNumber numberWithDouble: 1121], [NSNumber numberWithDouble: 1257], [NSNumber numberWithDouble: 1384], [NSNumber numberWithDouble: 1502], [NSNumber numberWithDouble: 1605], [NSNumber numberWithDouble: 1679], [NSNumber numberWithDouble: 1687], [NSNumber numberWithDouble: 1630], [NSNumber numberWithDouble: 1605], [NSNumber numberWithDouble: 1632], [NSNumber numberWithDouble: 1687], [NSNumber numberWithDouble: 1757], [NSNumber numberWithDouble: 1836], [NSNumber numberWithDouble: 2010], [NSNumber numberWithDouble: 2195], [NSNumber numberWithDouble: 2384], [NSNumber numberWithDouble: 2577], [NSNumber numberWithDouble: 2769], [NSNumber numberWithDouble: 2962], [NSNumber numberWithDouble: 3154], [NSNumber numberWithDouble: 3345], [NSNumber numberWithDouble: 3536], [NSNumber numberWithDouble: 3726], [NSNumber numberWithDouble: 3915], [NSNumber numberWithDouble: 4104], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 1.25], [NSNumber numberWithDouble: 993], [NSNumber numberWithDouble: 1113], [NSNumber numberWithDouble: 1225], [NSNumber numberWithDouble: 1325], [NSNumber numberWithDouble: 1403], [NSNumber numberWithDouble: 1434], [NSNumber numberWithDouble: 1396], [NSNumber numberWithDouble: 1372], [NSNumber numberWithDouble: 1391], [NSNumber numberWithDouble: 1440], [NSNumber numberWithDouble: 1502], [NSNumber numberWithDouble: 1574], [NSNumber numberWithDouble: 1651], [NSNumber numberWithDouble: 1816], [NSNumber numberWithDouble: 1987], [NSNumber numberWithDouble: 2161], [NSNumber numberWithDouble: 2336], [NSNumber numberWithDouble: 2511], [NSNumber numberWithDouble: 2686], [NSNumber numberWithDouble: 2860], [NSNumber numberWithDouble: 3033], [NSNumber numberWithDouble: 3206], [NSNumber numberWithDouble: 3378], [NSNumber numberWithDouble: 3550], [NSNumber numberWithDouble: 3722], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 1.5], [NSNumber numberWithDouble: 899], [NSNumber numberWithDouble: 1007], [NSNumber numberWithDouble: 1106], [NSNumber numberWithDouble: 1191], [NSNumber numberWithDouble: 1244], [NSNumber numberWithDouble: 1237], [NSNumber numberWithDouble: 1211], [NSNumber numberWithDouble: 1214], [NSNumber numberWithDouble: 1253], [NSNumber numberWithDouble: 1308], [NSNumber numberWithDouble: 1373], [NSNumber numberWithDouble: 1443], [NSNumber numberWithDouble: 1518], [NSNumber numberWithDouble: 1673], [NSNumber numberWithDouble: 1833], [NSNumber numberWithDouble: 1994], [NSNumber numberWithDouble: 2156], [NSNumber numberWithDouble: 2318], [NSNumber numberWithDouble: 2479], [NSNumber numberWithDouble: 2640], [NSNumber numberWithDouble: 2800], [NSNumber numberWithDouble: 2960], [NSNumber numberWithDouble: 3119], [NSNumber numberWithDouble: 3277], [NSNumber numberWithDouble: 3436], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 2], [NSNumber numberWithDouble: 766], [NSNumber numberWithDouble: 857], [NSNumber numberWithDouble: 936], [NSNumber numberWithDouble: 992], [NSNumber numberWithDouble: 1000], [NSNumber numberWithDouble: 990], [NSNumber numberWithDouble: 992], [NSNumber numberWithDouble: 1025], [NSNumber numberWithDouble: 1077], [NSNumber numberWithDouble: 1135], [NSNumber numberWithDouble: 1197], [NSNumber numberWithDouble: 1264], [NSNumber numberWithDouble: 1332], [NSNumber numberWithDouble: 1472], [NSNumber numberWithDouble: 1614], [NSNumber numberWithDouble: 1757], [NSNumber numberWithDouble: 1900], [NSNumber numberWithDouble: 2043], [NSNumber numberWithDouble: 2185], [NSNumber numberWithDouble: 2327], [NSNumber numberWithDouble: 2468], [NSNumber numberWithDouble: 2609], [NSNumber numberWithDouble: 2749], [NSNumber numberWithDouble: 2889], [NSNumber numberWithDouble: 3029], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 2.5], [NSNumber numberWithDouble: 674], [NSNumber numberWithDouble: 752], [NSNumber numberWithDouble: 815], [NSNumber numberWithDouble: 845], [NSNumber numberWithDouble: 845], [NSNumber numberWithDouble: 845], [NSNumber numberWithDouble: 870], [NSNumber numberWithDouble: 912], [NSNumber numberWithDouble: 964], [NSNumber numberWithDouble: 1020], [NSNumber numberWithDouble: 1080], [NSNumber numberWithDouble: 1142], [NSNumber numberWithDouble: 1205], [NSNumber numberWithDouble: 1334], [NSNumber numberWithDouble: 1463], [NSNumber numberWithDouble: 1593], [NSNumber numberWithDouble: 1723], [NSNumber numberWithDouble: 1852], [NSNumber numberWithDouble: 1981], [NSNumber numberWithDouble: 2110], [NSNumber numberWithDouble: 2238], [NSNumber numberWithDouble: 2366], [NSNumber numberWithDouble: 2493], [NSNumber numberWithDouble: 2620], [NSNumber numberWithDouble: 2747], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 3], [NSNumber numberWithDouble: 605], [NSNumber numberWithDouble: 673], [NSNumber numberWithDouble: 721], [NSNumber numberWithDouble: 733], [NSNumber numberWithDouble: 739], [NSNumber numberWithDouble: 753], [NSNumber numberWithDouble: 786], [NSNumber numberWithDouble: 830], [NSNumber numberWithDouble: 883], [NSNumber numberWithDouble: 938], [NSNumber numberWithDouble: 994], [NSNumber numberWithDouble: 1052], [NSNumber numberWithDouble: 1111], [NSNumber numberWithDouble: 1231], [NSNumber numberWithDouble: 1351], [NSNumber numberWithDouble: 1471], [NSNumber numberWithDouble: 1591], [NSNumber numberWithDouble: 1710], [NSNumber numberWithDouble: 1829], [NSNumber numberWithDouble: 1948], [NSNumber numberWithDouble: 2066], [NSNumber numberWithDouble: 2184], [NSNumber numberWithDouble: 2302], [NSNumber numberWithDouble: 2419], [NSNumber numberWithDouble: 2536], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 4], [NSNumber numberWithDouble: 505], [NSNumber numberWithDouble: 558], [NSNumber numberWithDouble: 584], [NSNumber numberWithDouble: 596], [NSNumber numberWithDouble: 613], [NSNumber numberWithDouble: 637], [NSNumber numberWithDouble: 682], [NSNumber numberWithDouble: 725], [NSNumber numberWithDouble: 773], [NSNumber numberWithDouble: 823], [NSNumber numberWithDouble: 874], [NSNumber numberWithDouble: 926], [NSNumber numberWithDouble: 979], [NSNumber numberWithDouble: 1085], [NSNumber numberWithDouble: 1191], [NSNumber numberWithDouble: 1297], [NSNumber numberWithDouble: 1402], [NSNumber numberWithDouble: 1508], [NSNumber numberWithDouble: 1613], [NSNumber numberWithDouble: 1718], [NSNumber numberWithDouble: 1822], [NSNumber numberWithDouble: 1926], [NSNumber numberWithDouble: 2030], [NSNumber numberWithDouble: 2133], [NSNumber numberWithDouble: 2236], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 5], [NSNumber numberWithDouble: 435], [NSNumber numberWithDouble: 476], [NSNumber numberWithDouble: 498], [NSNumber numberWithDouble: 515], [NSNumber numberWithDouble: 541], [NSNumber numberWithDouble: 567], [NSNumber numberWithDouble: 611], [NSNumber numberWithDouble: 654], [NSNumber numberWithDouble: 699], [NSNumber numberWithDouble: 745], [NSNumber numberWithDouble: 792], [NSNumber numberWithDouble: 839], [NSNumber numberWithDouble: 887], [NSNumber numberWithDouble: 983], [NSNumber numberWithDouble: 1080], [NSNumber numberWithDouble: 1176], [NSNumber numberWithDouble: 1272], [NSNumber numberWithDouble: 1367], [NSNumber numberWithDouble: 1463], [NSNumber numberWithDouble: 1558], [NSNumber numberWithDouble: 1652], [NSNumber numberWithDouble: 1747], [NSNumber numberWithDouble: 1841], [NSNumber numberWithDouble: 1935], [NSNumber numberWithDouble: 2028], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 7], [NSNumber numberWithDouble: 343], [NSNumber numberWithDouble: 377], [NSNumber numberWithDouble: 400], [NSNumber numberWithDouble: 425], [NSNumber numberWithDouble: 449], [NSNumber numberWithDouble: 487], [NSNumber numberWithDouble: 524], [NSNumber numberWithDouble: 562], [NSNumber numberWithDouble: 602], [NSNumber numberWithDouble: 642], [NSNumber numberWithDouble: 683], [NSNumber numberWithDouble: 724], [NSNumber numberWithDouble: 765], [NSNumber numberWithDouble: 849], [NSNumber numberWithDouble: 932], [NSNumber numberWithDouble: 1015], [NSNumber numberWithDouble: 1098], [NSNumber numberWithDouble: 1180], [NSNumber numberWithDouble: 1262], [NSNumber numberWithDouble: 1344], [NSNumber numberWithDouble: 1426], [NSNumber numberWithDouble: 1508], [NSNumber numberWithDouble: 1589], [NSNumber numberWithDouble: 1670], [NSNumber numberWithDouble: 1750], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 10], [NSNumber numberWithDouble: 275], [NSNumber numberWithDouble: 304], [NSNumber numberWithDouble: 329], [NSNumber numberWithDouble: 350], [NSNumber numberWithDouble: 382], [NSNumber numberWithDouble: 413], [NSNumber numberWithDouble: 446], [NSNumber numberWithDouble: 479], [NSNumber numberWithDouble: 514], [NSNumber numberWithDouble: 549], [NSNumber numberWithDouble: 584], [NSNumber numberWithDouble: 619], [NSNumber numberWithDouble: 655], [NSNumber numberWithDouble: 726], [NSNumber numberWithDouble: 797], [NSNumber numberWithDouble: 868], [NSNumber numberWithDouble: 939], [NSNumber numberWithDouble: 1010], [NSNumber numberWithDouble: 1080], [NSNumber numberWithDouble: 1150], [NSNumber numberWithDouble: 1220], [NSNumber numberWithDouble: 1290], [NSNumber numberWithDouble: 1359], [NSNumber numberWithDouble: 1428], [NSNumber numberWithDouble: 1498], nil], nil];
        chart.deflectionCoefficient = nil;
        chart.deflectionData = nil;
        chart.deflectionLoadData = nil;
        [self.materials addObject:chart];

        // Chart 2
        chart = [[Material_Chart alloc] init];
        chart.sidesSupported = @4;
        chart.laminationType = @"Monolithic";
        chart.thickness = [[Material_Thickness alloc] initWithNames:@"3/32 in." and:@"2.5 mm" andThickness:[NSNumber numberWithDouble: 2.16]];
        chart.thicknessLongDuration = [[Material_Thickness alloc] initWithNames:@"3/32 in." and:@"2.5 mm" andThickness:[NSNumber numberWithDouble: 2.16]];
        chart.NFLData = [[NSArray alloc] initWithObjects:[[NSArray alloc] initWithObjects:@-1, [NSNumber numberWithDouble: 1], [NSNumber numberWithDouble: 1.25], [NSNumber numberWithDouble: 1.5], [NSNumber numberWithDouble: 1.75], [NSNumber numberWithDouble: 2], [NSNumber numberWithDouble: 2.25], [NSNumber numberWithDouble: 2.5], [NSNumber numberWithDouble: 2.75], [NSNumber numberWithDouble: 3], [NSNumber numberWithDouble: 3.25], [NSNumber numberWithDouble: 3.5], [NSNumber numberWithDouble: 3.75], [NSNumber numberWithDouble: 4], [NSNumber numberWithDouble: 4.5], [NSNumber numberWithDouble: 5], [NSNumber numberWithDouble: 5.5], [NSNumber numberWithDouble: 6], [NSNumber numberWithDouble: 6.5], [NSNumber numberWithDouble: 7], [NSNumber numberWithDouble: 7.5], [NSNumber numberWithDouble: 8], [NSNumber numberWithDouble: 8.5], [NSNumber numberWithDouble: 9], [NSNumber numberWithDouble: 9.5], [NSNumber numberWithDouble: 10], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 0.25], [NSNumber numberWithDouble: 2336], [NSNumber numberWithDouble: 2619], [NSNumber numberWithDouble: 2888], [NSNumber numberWithDouble: 3144], [NSNumber numberWithDouble: 3388], [NSNumber numberWithDouble: 3629], [NSNumber numberWithDouble: 3857], [NSNumber numberWithDouble: 4081], [NSNumber numberWithDouble: 4289], [NSNumber numberWithDouble: 4479], [NSNumber numberWithDouble: 4636], [NSNumber numberWithDouble: 4726], [NSNumber numberWithDouble: 4691], [NSNumber numberWithDouble: 4361], [NSNumber numberWithDouble: 4377], [NSNumber numberWithDouble: 4574], [NSNumber numberWithDouble: 4845], [NSNumber numberWithDouble: 5150], [NSNumber numberWithDouble: 5475], [NSNumber numberWithDouble: 5811], [NSNumber numberWithDouble: 6154], [NSNumber numberWithDouble: 6499], [NSNumber numberWithDouble: 6846], [NSNumber numberWithDouble: 7194], [NSNumber numberWithDouble: 7541], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 0.5], [NSNumber numberWithDouble: 1621], [NSNumber numberWithDouble: 1817], [NSNumber numberWithDouble: 2004], [NSNumber numberWithDouble: 2182], [NSNumber numberWithDouble: 2351], [NSNumber numberWithDouble: 2512], [NSNumber numberWithDouble: 2656], [NSNumber numberWithDouble: 2775], [NSNumber numberWithDouble: 2834], [NSNumber numberWithDouble: 2784], [NSNumber numberWithDouble: 2669], [NSNumber numberWithDouble: 2627], [NSNumber numberWithDouble: 2657], [NSNumber numberWithDouble: 2811], [NSNumber numberWithDouble: 3021], [NSNumber numberWithDouble: 3257], [NSNumber numberWithDouble: 3504], [NSNumber numberWithDouble: 3758], [NSNumber numberWithDouble: 4016], [NSNumber numberWithDouble: 4275], [NSNumber numberWithDouble: 4534], [NSNumber numberWithDouble: 4792], [NSNumber numberWithDouble: 5050], [NSNumber numberWithDouble: 5307], [NSNumber numberWithDouble: 5563], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 0.75], [NSNumber numberWithDouble: 1308], [NSNumber numberWithDouble: 1466], [NSNumber numberWithDouble: 1616], [NSNumber numberWithDouble: 1757], [NSNumber numberWithDouble: 1888], [NSNumber numberWithDouble: 2003], [NSNumber numberWithDouble: 2083], [NSNumber numberWithDouble: 2090], [NSNumber numberWithDouble: 2013], [NSNumber numberWithDouble: 1968], [NSNumber numberWithDouble: 1988], [NSNumber numberWithDouble: 2044], [NSNumber numberWithDouble: 2119], [NSNumber numberWithDouble: 2299], [NSNumber numberWithDouble: 2499], [NSNumber numberWithDouble: 2710], [NSNumber numberWithDouble: 2925], [NSNumber numberWithDouble: 3143], [NSNumber numberWithDouble: 3360], [NSNumber numberWithDouble: 3578], [NSNumber numberWithDouble: 3795], [NSNumber numberWithDouble: 4011], [NSNumber numberWithDouble: 4227], [NSNumber numberWithDouble: 4442], [NSNumber numberWithDouble: 4656], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 1], [NSNumber numberWithDouble: 1121], [NSNumber numberWithDouble: 1257], [NSNumber numberWithDouble: 1384], [NSNumber numberWithDouble: 1502], [NSNumber numberWithDouble: 1605], [NSNumber numberWithDouble: 1679], [NSNumber numberWithDouble: 1687], [NSNumber numberWithDouble: 1630], [NSNumber numberWithDouble: 1605], [NSNumber numberWithDouble: 1632], [NSNumber numberWithDouble: 1687], [NSNumber numberWithDouble: 1757], [NSNumber numberWithDouble: 1836], [NSNumber numberWithDouble: 2010], [NSNumber numberWithDouble: 2195], [NSNumber numberWithDouble: 2384], [NSNumber numberWithDouble: 2577], [NSNumber numberWithDouble: 2769], [NSNumber numberWithDouble: 2962], [NSNumber numberWithDouble: 3154], [NSNumber numberWithDouble: 3345], [NSNumber numberWithDouble: 3536], [NSNumber numberWithDouble: 3726], [NSNumber numberWithDouble: 3915], [NSNumber numberWithDouble: 4104], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 1.25], [NSNumber numberWithDouble: 993], [NSNumber numberWithDouble: 1113], [NSNumber numberWithDouble: 1225], [NSNumber numberWithDouble: 1325], [NSNumber numberWithDouble: 1403], [NSNumber numberWithDouble: 1434], [NSNumber numberWithDouble: 1396], [NSNumber numberWithDouble: 1372], [NSNumber numberWithDouble: 1391], [NSNumber numberWithDouble: 1440], [NSNumber numberWithDouble: 1502], [NSNumber numberWithDouble: 1574], [NSNumber numberWithDouble: 1651], [NSNumber numberWithDouble: 1816], [NSNumber numberWithDouble: 1987], [NSNumber numberWithDouble: 2161], [NSNumber numberWithDouble: 2336], [NSNumber numberWithDouble: 2511], [NSNumber numberWithDouble: 2686], [NSNumber numberWithDouble: 2860], [NSNumber numberWithDouble: 3033], [NSNumber numberWithDouble: 3206], [NSNumber numberWithDouble: 3378], [NSNumber numberWithDouble: 3550], [NSNumber numberWithDouble: 3722], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 1.5], [NSNumber numberWithDouble: 899], [NSNumber numberWithDouble: 1007], [NSNumber numberWithDouble: 1106], [NSNumber numberWithDouble: 1191], [NSNumber numberWithDouble: 1244], [NSNumber numberWithDouble: 1237], [NSNumber numberWithDouble: 1211], [NSNumber numberWithDouble: 1214], [NSNumber numberWithDouble: 1253], [NSNumber numberWithDouble: 1308], [NSNumber numberWithDouble: 1373], [NSNumber numberWithDouble: 1443], [NSNumber numberWithDouble: 1518], [NSNumber numberWithDouble: 1673], [NSNumber numberWithDouble: 1833], [NSNumber numberWithDouble: 1994], [NSNumber numberWithDouble: 2156], [NSNumber numberWithDouble: 2318], [NSNumber numberWithDouble: 2479], [NSNumber numberWithDouble: 2640], [NSNumber numberWithDouble: 2800], [NSNumber numberWithDouble: 2960], [NSNumber numberWithDouble: 3119], [NSNumber numberWithDouble: 3277], [NSNumber numberWithDouble: 3436], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 2], [NSNumber numberWithDouble: 766], [NSNumber numberWithDouble: 857], [NSNumber numberWithDouble: 936], [NSNumber numberWithDouble: 992], [NSNumber numberWithDouble: 1000], [NSNumber numberWithDouble: 990], [NSNumber numberWithDouble: 992], [NSNumber numberWithDouble: 1025], [NSNumber numberWithDouble: 1077], [NSNumber numberWithDouble: 1135], [NSNumber numberWithDouble: 1197], [NSNumber numberWithDouble: 1264], [NSNumber numberWithDouble: 1332], [NSNumber numberWithDouble: 1472], [NSNumber numberWithDouble: 1614], [NSNumber numberWithDouble: 1757], [NSNumber numberWithDouble: 1900], [NSNumber numberWithDouble: 2043], [NSNumber numberWithDouble: 2185], [NSNumber numberWithDouble: 2327], [NSNumber numberWithDouble: 2468], [NSNumber numberWithDouble: 2609], [NSNumber numberWithDouble: 2749], [NSNumber numberWithDouble: 2889], [NSNumber numberWithDouble: 3029], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 2.5], [NSNumber numberWithDouble: 674], [NSNumber numberWithDouble: 752], [NSNumber numberWithDouble: 815], [NSNumber numberWithDouble: 845], [NSNumber numberWithDouble: 845], [NSNumber numberWithDouble: 845], [NSNumber numberWithDouble: 870], [NSNumber numberWithDouble: 912], [NSNumber numberWithDouble: 964], [NSNumber numberWithDouble: 1020], [NSNumber numberWithDouble: 1080], [NSNumber numberWithDouble: 1142], [NSNumber numberWithDouble: 1205], [NSNumber numberWithDouble: 1334], [NSNumber numberWithDouble: 1463], [NSNumber numberWithDouble: 1593], [NSNumber numberWithDouble: 1723], [NSNumber numberWithDouble: 1852], [NSNumber numberWithDouble: 1981], [NSNumber numberWithDouble: 2110], [NSNumber numberWithDouble: 2238], [NSNumber numberWithDouble: 2366], [NSNumber numberWithDouble: 2493], [NSNumber numberWithDouble: 2620], [NSNumber numberWithDouble: 2747], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 3], [NSNumber numberWithDouble: 605], [NSNumber numberWithDouble: 673], [NSNumber numberWithDouble: 721], [NSNumber numberWithDouble: 733], [NSNumber numberWithDouble: 739], [NSNumber numberWithDouble: 753], [NSNumber numberWithDouble: 786], [NSNumber numberWithDouble: 830], [NSNumber numberWithDouble: 883], [NSNumber numberWithDouble: 938], [NSNumber numberWithDouble: 994], [NSNumber numberWithDouble: 1052], [NSNumber numberWithDouble: 1111], [NSNumber numberWithDouble: 1231], [NSNumber numberWithDouble: 1351], [NSNumber numberWithDouble: 1471], [NSNumber numberWithDouble: 1591], [NSNumber numberWithDouble: 1710], [NSNumber numberWithDouble: 1829], [NSNumber numberWithDouble: 1948], [NSNumber numberWithDouble: 2066], [NSNumber numberWithDouble: 2184], [NSNumber numberWithDouble: 2302], [NSNumber numberWithDouble: 2419], [NSNumber numberWithDouble: 2536], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 4], [NSNumber numberWithDouble: 505], [NSNumber numberWithDouble: 558], [NSNumber numberWithDouble: 584], [NSNumber numberWithDouble: 596], [NSNumber numberWithDouble: 613], [NSNumber numberWithDouble: 637], [NSNumber numberWithDouble: 682], [NSNumber numberWithDouble: 725], [NSNumber numberWithDouble: 773], [NSNumber numberWithDouble: 823], [NSNumber numberWithDouble: 874], [NSNumber numberWithDouble: 926], [NSNumber numberWithDouble: 979], [NSNumber numberWithDouble: 1085], [NSNumber numberWithDouble: 1191], [NSNumber numberWithDouble: 1297], [NSNumber numberWithDouble: 1402], [NSNumber numberWithDouble: 1508], [NSNumber numberWithDouble: 1613], [NSNumber numberWithDouble: 1718], [NSNumber numberWithDouble: 1822], [NSNumber numberWithDouble: 1926], [NSNumber numberWithDouble: 2030], [NSNumber numberWithDouble: 2133], [NSNumber numberWithDouble: 2236], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 5], [NSNumber numberWithDouble: 435], [NSNumber numberWithDouble: 476], [NSNumber numberWithDouble: 498], [NSNumber numberWithDouble: 515], [NSNumber numberWithDouble: 541], [NSNumber numberWithDouble: 567], [NSNumber numberWithDouble: 611], [NSNumber numberWithDouble: 654], [NSNumber numberWithDouble: 699], [NSNumber numberWithDouble: 745], [NSNumber numberWithDouble: 792], [NSNumber numberWithDouble: 839], [NSNumber numberWithDouble: 887], [NSNumber numberWithDouble: 983], [NSNumber numberWithDouble: 1080], [NSNumber numberWithDouble: 1176], [NSNumber numberWithDouble: 1272], [NSNumber numberWithDouble: 1367], [NSNumber numberWithDouble: 1463], [NSNumber numberWithDouble: 1558], [NSNumber numberWithDouble: 1652], [NSNumber numberWithDouble: 1747], [NSNumber numberWithDouble: 1841], [NSNumber numberWithDouble: 1935], [NSNumber numberWithDouble: 2028], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 7], [NSNumber numberWithDouble: 343], [NSNumber numberWithDouble: 377], [NSNumber numberWithDouble: 400], [NSNumber numberWithDouble: 425], [NSNumber numberWithDouble: 449], [NSNumber numberWithDouble: 487], [NSNumber numberWithDouble: 524], [NSNumber numberWithDouble: 562], [NSNumber numberWithDouble: 602], [NSNumber numberWithDouble: 642], [NSNumber numberWithDouble: 683], [NSNumber numberWithDouble: 724], [NSNumber numberWithDouble: 765], [NSNumber numberWithDouble: 849], [NSNumber numberWithDouble: 932], [NSNumber numberWithDouble: 1015], [NSNumber numberWithDouble: 1098], [NSNumber numberWithDouble: 1180], [NSNumber numberWithDouble: 1262], [NSNumber numberWithDouble: 1344], [NSNumber numberWithDouble: 1426], [NSNumber numberWithDouble: 1508], [NSNumber numberWithDouble: 1589], [NSNumber numberWithDouble: 1670], [NSNumber numberWithDouble: 1750], nil],
                         [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble: 10], [NSNumber numberWithDouble: 275], [NSNumber numberWithDouble: 304], [NSNumber numberWithDouble: 329], [NSNumber numberWithDouble: 350], [NSNumber numberWithDouble: 382], [NSNumber numberWithDouble: 413], [NSNumber numberWithDouble: 446], [NSNumber numberWithDouble: 479], [NSNumber numberWithDouble: 514], [NSNumber numberWithDouble: 549], [NSNumber numberWithDouble: 584], [NSNumber numberWithDouble: 619], [NSNumber numberWithDouble: 655], [NSNumber numberWithDouble: 726], [NSNumber numberWithDouble: 797], [NSNumber numberWithDouble: 868], [NSNumber numberWithDouble: 939], [NSNumber numberWithDouble: 1010], [NSNumber numberWithDouble: 1080], [NSNumber numberWithDouble: 1150], [NSNumber numberWithDouble: 1220], [NSNumber numberWithDouble: 1290], [NSNumber numberWithDouble: 1359], [NSNumber numberWithDouble: 1428], [NSNumber numberWithDouble: 1498], nil], nil];
        chart.deflectionCoefficient = nil;
        chart.deflectionData = nil;
        chart.deflectionLoadData = nil;
        [self.materials addObject:chart];