Try the search, it's linked to some great forums

Friday, August 17, 2012

UCSC's City on the Hill Magazine - rack locations


View UCSC - City on the Hill Magazine in a larger map

Thursday, August 9, 2012

Creating and array of index letters

The following method allows you to supply an array of dictionaries and obtain a sorted index array of any key for use in an indexed tableView;
// Takes the array in question and creates an index for use in the tableview
- (NSArray *)makeSectionsIndex:(NSArray *)arrayOfDictionaries {
   
// Creates a mutable set to read each letter only once   
    NSMutableSet *sectionsMutableSet = [NSMutableSet setWithCapacity:26];
   
// Reads each item's country & loads it's first letter into sections set
    for (int i=0; i<=[arrayOfDictionaries count]-1; i++) {
        NSDictionary *aDictionary = [arrayOfDictionaries objectAtIndex:i];
        NSString *aCountry = [aDictionary objectForKey:@"Country"];
        NSString *aLetter = [aCountry substringToIndex:1U];         //uses first letter of string
        [sectionsMutableSet addObject:aLetter];
    }
   
// Copies the mutable set into a set & then make a mutable array of the set
    NSSet *sectionsSet = [NSSet setWithSet:sectionsMutableSet];
    NSMutableArray *sectionsMutableArray = [[sectionsSet allObjects] mutableCopy];
   
//Now let's sort the array and make it inmutable
    NSMutableArray *sortedMutableArray = [[NSMutableArray alloc] init];
    sortedMutableArray = [sectionsMutableArray        sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
    NSArray *sortedIndexArray = [NSArray arrayWithArray:sortedMutableArray];

//    NSLog(@"%@", sortedIndexArray);
    return sortedIndexArray;                                                  
}


posted from MyMapView, masterViewController by CPL

Bootstrap server error

The following error;
Couldn't register CPL.XXX with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.
comes up when downloading to my iPad occasionally.  It's telling us that the device (iPad) has another version of the project running, even if you've stopped & deleted the app.

Best solution is turning OFF the device & restarting it.  Seems to work & makes sense.

Sunday, August 5, 2012

Creates a plist from an Excel spreadsheet

Here's a quick & easy way to get data sets to use in iPhone apps. We take any simple spreadsheet with the first row as the titles or keys, and convert it to a simple plist.
  1. Save your spreadsheet as a .CSV file 
  2. Get a copy of this great little executable, PList Converter, and 'drag N drop' your .csv file into it
  3. Out pops a nicely formatted .plist file that you can drop into your Xcode project.
  4. Open the file in TextEdit and note the format of the XML file.  In this case it is an ARRAY of DICTIONARIES.  This is important for subsequent operations in Xcode
To import this file into an actual project.  Drop the file into the project like normal & then use the following MainBundle commands;
    NSBundle *mainBundle = [NSBundle mainBundle];
    NSURL *countriesArrayURL = [mainBundle URLForResource:@"WorldTestData"       withExtension:@"plist"];
    self.countriesArray = [NSArray arrayWithContentsOfURL:countriesArrayURL];

Many thanks to Danilo Campos for the binary!

Friday, August 3, 2012

Google Earth viewer - Blaine's trav(ai)els

Here's a view of one of Blaine's flights built on the iPhone with MotionX, uploaded into Google Maps, and displayed on the blog! More tweeking to come.