This is a very simple way to pass parameters between various views.
1st in the appDelegate.m file add;
// NSUserDefault setup for passing info around the app the starting default values.
[[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"list_filtered"];
[[NSUserDefaults standardUserDefaults] setInteger:1 forKey:@"selected_spreadsheet"];
[[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"selected_map_type"];
[[NSUserDefaults standardUserDefaults] setObject:@"ALL" forKey:@"selected_driver"];
[[NSUserDefaults standardUserDefaults] setObject:@"initialString" forKey:@"selected_plist"];
[[NSUserDefaults standardUserDefaults] setObject:@"initialDictionary" forKey:@"selected_member"];
[[NSUserDefaults standardUserDefaults] setObject:@"selectedIndexPath" forKey:@"selected_indexPath"];
// sync the defaults to disk
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
[[NSUserDefaults standardUserDefaults] synchronize];
Try the search, it's linked to some great forums
Showing posts with label apps design. Show all posts
Showing posts with label apps design. Show all posts
Friday, November 13, 2015
Friday, July 17, 2015
Simple Database creation for Apps
This is my quick go to for creating a data file to use in an app. There are other better, quicker and more complex, but this is quick & easy/peasey!

That's all she wrote.
- Create a CSV file in the speadsheet of your choice. I use either Google's or OpenOffice.
- Run the file thru my favorite converter - Plist Converter, by cc ccc. It's also easy. Couldn't find the url, but here's what it looks like;
- Copy the resultant fileName.plist into your project.
- Write yourself some code to translae it into an NSArray or somethin'.
That's all she wrote.
Saturday, January 17, 2015
Facebook Integration notes
Notes & research;
FB Graph API URL - https://developers.facebook.com/docs/graph-api/common-scenarios
From FBs documentation
Good Wenderlich tutorial - http://www.raywenderlich.com/1626/facebook-tutorial-for-ios-how-to-post-to-a-user-wall-upload-photos-and-add-a-like-button-from-your-iphone-app
More Info from FBs API
Stunning example of FBs Story photo album I take back what I said about FBs slideshow features!
https://www.facebook.com/fanpage.it/posts/945924002095941
FB Graph API URL - https://developers.facebook.com/docs/graph-api/common-scenarios
From FBs documentation
Other links:Uploading Photos and Creating Photo AlbumsApps are able to publish and create new photo albums, and publish photos via the Graph API on behalf of people or Facebook Pages. Photos can be uploaded by sending the actual image files, or by using URLs of images already on the internet.
Read These Docs
Use These APIs
- Platform Policies that cover publishing behavior in apps.
- Guide to Publishing with the Graph API.
/{user-id}/albums
to create empty photo albums for people./{user-id}/photos
to add individual photos for people./{page-id}/albums
to create empty photo albums for Facebook Pages./{page-id}/photos
to add individual photos for Facebook Pages./{album-id}/photos
to add photos to an existing album for people or for Pages.
Good Wenderlich tutorial - http://www.raywenderlich.com/1626/facebook-tutorial-for-ios-how-to-post-to-a-user-wall-upload-photos-and-add-a-like-button-from-your-iphone-app
More Info from FBs API
FBs tutorial for an Open Graph Story integration - https://developers.facebook.com/docs/ios/open-graphTelling Stories with Open GraphOpen Graph lets apps tell stories on Facebook through a structured, strongly typed API.
People use stories to share the things they're doing, the people they're doing them with and the places where they happen. Open Graph lets you integrate apps deeply into the Facebook experience, which increases engagement, distribution and growth.
Stunning example of FBs Story photo album I take back what I said about FBs slideshow features!
https://www.facebook.com/fanpage.it/posts/945924002095941
Tuesday, July 9, 2013
Turn-by-Turn Routing for your app
The following method takes the User's location and the destination's location and sends them to the iPhone's native Maps app for their Turn-by-Turn routing. Most excellent!!
Looks like this:
The method:
- (IBAction)turnByRouting:(UIBarButtonItem *)sender {
NSLog(@"Opens the native Map app's turn-by-turn navigation");
//business location
// test location
// CLLocationCoordinate2D coords = CLLocationCoordinate2DMake(37.0469,-122.0308);
// Gets the coordinates from the single pinsArray object
NSString *latitude = [[self.pinsArray objectAtIndex:0] objectForKey:@"latitude"];
NSString *longitude = [[self.pinsArray objectAtIndex:0] objectForKey:@"longitude"];
CLLocationCoordinate2D coords = CLLocationCoordinate2DMake([latitude
doubleValue], [longitude doubleValue]);
MKPlacemark *place = [[MKPlacemark alloc] initWithCoordinate:coords addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place];
//current location
MKMapItem *mapItem2 = [MKMapItem mapItemForCurrentLocation];
NSArray *mapItems = @[mapItem, mapItem2];
NSDictionary *options = @{
MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving,
MKLaunchOptionsMapTypeKey:[NSNumber numberWithInteger:MKMapTypeStandard],
MKLaunchOptionsShowsTrafficKey:@YES
};
[MKMapItem openMapsWithItems:mapItems launchOptions:options];
}
Looks like this:
The method:
- (IBAction)turnByRouting:(UIBarButtonItem *)sender {
NSLog(@"Opens the native Map app's turn-by-turn navigation");
//business location
// test location
// CLLocationCoordinate2D coords = CLLocationCoordinate2DMake(37.0469,-122.0308);
// Gets the coordinates from the single pinsArray object
NSString *latitude = [[self.pinsArray objectAtIndex:0] objectForKey:@"latitude"];
NSString *longitude = [[self.pinsArray objectAtIndex:0] objectForKey:@"longitude"];
CLLocationCoordinate2D coords = CLLocationCoordinate2DMake([latitude
doubleValue], [longitude doubleValue]);
MKPlacemark *place = [[MKPlacemark alloc] initWithCoordinate:coords addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place];
//current location
MKMapItem *mapItem2 = [MKMapItem mapItemForCurrentLocation];
NSArray *mapItems = @[mapItem, mapItem2];
NSDictionary *options = @{
MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving,
MKLaunchOptionsMapTypeKey:[NSNumber numberWithInteger:MKMapTypeStandard],
MKLaunchOptionsShowsTrafficKey:@YES
};
[MKMapItem openMapsWithItems:mapItems launchOptions:options];
}
Labels:
apps design,
geolocation,
mapping,
method,
route,
snippet,
Xcode
Friday, November 30, 2012
Great Xcode tutorials
Here's a running list of tutorials;
Passing Data Between Views - http://www.geekylemon.com/WEBPROTECT-xcodepassingdataviews.htm
Passing Data Between Views - http://www.geekylemon.com/WEBPROTECT-xcodepassingdataviews.htm
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;
posted from MyMapView, masterViewController by CPL
// 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
Thursday, July 5, 2012
Creating a tableView Index
This implementation is from a tableView that is using coreData & fetchRequests as the model. It's necessary to implement the following dataSource delegate methods. Also there is a simple method in the table's data class which selects for 'first character'.
in WordsTableViewController.m - implement the following delegate methods
#pragma mark - UITableViewDataSource indexList Methods
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
return [self.fetchedResultsController sectionIndexTitles];
}
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
return [self.fetchedResultsController sectionForSectionIndexTitle:title atIndex:index];
}
in Items.m - this method uses the 1st character of each word as it's index
-(NSString *)firstChar {
return [self.word substringToIndex:1U];
}
in WordTableViewController.m - And most importantly in the (void)setupFetchedResultsController method the firstChar is used as the sort parameter.
self.fetchedResultsController = [[NSFetchedResultsController alloc]
initWithFetchRequest:request
managedObjectContext:self.wordDictionary.managedObjectContext
sectionNameKeyPath:@"firstChar"
cacheName:nil];
ref: myDictionary by CPL
in WordsTableViewController.m - implement the following delegate methods
#pragma mark - UITableViewDataSource indexList Methods
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
return [self.fetchedResultsController sectionIndexTitles];
}
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
return [self.fetchedResultsController sectionForSectionIndexTitle:title atIndex:index];
}
in Items.m - this method uses the 1st character of each word as it's index
-(NSString *)firstChar {
return [self.word substringToIndex:1U];
}
in WordTableViewController.m - And most importantly in the (void)setupFetchedResultsController method the firstChar is used as the sort parameter.
self.fetchedResultsController = [[NSFetchedResultsController alloc]
initWithFetchRequest:request
managedObjectContext:self.wordDictionary.managedObjectContext
sectionNameKeyPath:@"firstChar"
cacheName:nil];
ref: myDictionary by CPL
Saturday, May 19, 2012
iPhone screen rotation logic
This is the proper implementation for screen rotation (example is portrait or upside down portrait);
You should also set the view mode in the view's Attribute inspector on the storyboard.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation
==UIInterfaceOrientationPortraitUpsideDown)) {
return YES;
} else {
return NO;
}
}
the other possible states are UIInterfaceOrientationLandscapeLeft or UIInterfaceOrientationLandscapeRight.if ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation
==UIInterfaceOrientationPortraitUpsideDown)) {
return YES;
} else {
return NO;
}
}
You should also set the view mode in the view's Attribute inspector on the storyboard.
Friday, March 23, 2012
New Tricks n Tips for your iPad, iPhone & Xcode
The following links are for some good reference info on how to do various unusual things on your iThings and also Xcode.
Backing up your iPad or Iphone - This will allow you to load different versions of the iOS, secure your apps & data and .... or just follow this;
in your iPad; go to Settings - Photos - Photo Stream ON
Backing up your iPad or Iphone - This will allow you to load different versions of the iOS, secure your apps & data and .... or just follow this;
iTunes
How to back up
iTunes can create backups of your iOS device when you:
- Sync with iTunes (disabled if you have iCloud backup turned on)
- Right-click (or Control-click) the iOS device in iTunes under Devices and choose Back Up
Use these steps to manually back up your iOS device using iTunes:
- Connect your iOS device to a computer with the latest version of iTunes installed
- Select your iOS device in iTunes under Devices
- Right-click (or Control-click) the device and select Back Up
in your iPad; go to Settings - Photos - Photo Stream ON
Tuesday, February 7, 2012
Sunday, January 1, 2012
Panoramio demo - *** Version 4 Location & Tag selectable
Panoramio demo - version 03 User Selected Content
Let's now try a just MY photos (user=1550977;) and other embedded data fields. Detailed Panoramio API
slideshow.htmlThese examples use panoramio's HTML widgets. For more detail we need to work with JavaScript
Panoramio demo - version 02 Embedded Slideshow
Let's now try a slideshow from within this frame, or can this be any easier?
Panoramio demo - version 01 simple iframe
This is the simplest version of the Panoramio api using an iframe script from the Panoramio api site.
Thursday, December 1, 2011
Subscribe to:
Posts (Atom)