Created
February 25, 2010 21:32
-
-
Save quique123/315056 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)synchronousLoadFlickrData{ | |
NSLog(@"BEGINLOADINGflickr dictionary"); | |
PaparazziAppDelegate *appDelegate= (PaparazziAppDelegate *)[[UIApplication sharedApplication] delegate]; | |
// GET PLIST FILE INFO | |
filePath = [[NSBundle mainBundle] pathForResource:@"FakeData" ofType:@"plist"]; | |
if (filePath) | |
{ | |
// CREATE FLICKR ARRAY FROM PLIST FILE PATH | |
NSArray *twitterIds = [NSArray arrayWithContentsOfFile:filePath]; | |
for (NSDictionary *dict in twitterIds) | |
{ | |
// Step 1: Create Object | |
Photo* newPhoto = (Photo*)[NSEntityDescription insertNewObjectForEntityForName:@"Photo" inManagedObjectContext:managedObjectContext]; | |
// Step 2: Set Properties | |
NSLog(@"Entering Photo Name:%@",[dict objectForKey:@"name"]); | |
[newPhoto setPhotoName:[dict objectForKey:@"name"]]; | |
NSLog(@"SettingPhotoURL:%@",[dict objectForKey:@"path"]); | |
[newPhoto setPhotoURL:[dict objectForKey:@"path"]]; | |
NSLog(@"SettingOwnerName:%@",[dict objectForKey:@"user"]); | |
[newPhoto setOwnerName:[dict objectForKey:@"user"]]; | |
} | |
// Step 3: Save Object | |
[appDelegate saveAction]; | |
} | |
} | |
[self performSelectorOnMainThread:@selector(didFinishLoadingFlickrDataWithResults:) withObject:nil waitUntilDone:NO]; | |
NSLog(@"leaving synchronousLoadFlickrData"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment