Super quick question, my initial thought was this is not going to work, but then I thought why not give it a go. Now I am thinking it won’t work as the resultant array does not seem to be properly formed? My question, should this work?
NSUInteger numPoints = [[[self dataModel] locationFake] count];
CLLocationCoordinate2D points[numPoints];
No, it wouldn’t work as the
points[]array needs to be sized statically. That is, the compiler needs to know the size of that array, but can’t possibly know it until runtime.If you change it to:
That should work. Just don’t forget to
free()it later when you are done.