Skip to content

Instantly share code, notes, and snippets.

@evanlong
evanlong / PhantomLines.m
Created February 3, 2011 00:57
Phantom lines appear on either the zero latitude or longitude axis if a point's latitude or longitudes settings are zero. Since both are zero in this case it will appear on both. This only occurs if the line width for the polyline is <= 1.
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
CLLocationCoordinate2D points[2];
points[0].latitude = 0;
points[0].longitude = 0;
points[1].latitude = -6;
points[1].longitude = 5;
MKPolyline* polyline = [MKPolyline polylineWithCoordinates:points count:2];
@evanlong
evanlong / UITableViewRace.m
Created January 31, 2011 08:13
infectmac.com blog post code sample about UITableView and GCD race condition
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
NSDictionary* pictObj = [self.pictures objectAtIndex:indexPath.row];
NSString* title = [pictObj objectForKey:@"title"];
int main(int argc, char** argv) {
printf("hello world\n");
}