Bordertown Labs Blog

Notes from Bordertown Labs with posts regarding software development for the iPhone, Ruby on Rails, tips and code.

» Contact with inquiries.


Visualize your geodata in augmented reality with 3DAR by Spot Metrix.


Posts tagged "howto"

Oct 3rd, 2011 @ 2:12 am

(via How to Check-In Using the Facebook iOS SDK and Graph API | Tyler White Design)

(via How to Check-In Using the Facebook iOS SDK and Graph API | Tyler White Design)




Comments (View)

 


 

Sep 20th, 2011 @ 5:38 pm

Using GCD and Blocks Effectively


dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
    NSURL *url = [NSURL URLWithString:@"http://bit.ly/nUX01h"];
    NSURLRequest *req = [NSURLRequest requestWithURL:url];
    [NSURLConnection sendAsynchronousRequest:req
                                       queue:[NSOperationQueue currentQueue]
                           completionHandler:
     ^(NSURLResponse *res, NSData *data, NSError *err) {
         // Convert the data to a UIImage
         UIImage *image = [UIImage imageWithData:data];
           
         // Scale the image
         UIImage *thumbImage = nil;
         CGSize newSize = CGSizeMake(90, (90 / image.size.width) * image.size.height);
         UIGraphicsBeginImageContext(newSize);
         [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
         thumbImage = UIGraphicsGetImageFromCurrentImageContext();
         UIGraphicsEndImageContext();
           
         dispatch_async(dispatch_get_main_queue(), ^{
             self.imageView.image = thumbImage;
         });
     }];
});




Comments (View)

 


 

Jul 22nd, 2009 @ 4:50 pm

How to reload a tableView after changing

Let’s say your UITableViewController implements the NSFetchedResultsControllerDelegate.  When you add, remove or change Core Data objects in your context, you’d expect the table view to update, right?  Make sure you include the following code in your controller.

- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
[self.tableView reloadData];
}




Comments (View)

 


 

Archive · RSS · Theme by Autumn