Skip to content

Instantly share code, notes, and snippets.

View casspangell's full-sized avatar

mondousage casspangell

View GitHub Profile
(
{
category = "Food/beverages";
"category_list" = (
{
id = 188296324525457;
name = "Sandwich Shop";
}
);
id = 69321426952;
-(void) processResponseData: (NSDictionary *) responseData {
// NSLog(@"%@", responseData);
NSArray *arrayOfLocations = [responseData objectForKey:@"data"];
NSDictionary *place = [arrayOfLocations objectAtIndex:2];
NSString *placeName = [place objectForKey:@"name"]; // aka Quiznos
NSString *category = [place objectForKey:@"category"]; // aka Food/beverages
NSArray *arrayOfCategoryList = [place objectForKey:@"category_list"];
-(void) processResponseData: (NSDictionary *) resultData {
NSLog(@"%@", resultData);
// do the JSON conversion on a separate queue
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
^{
NSError *error = nil;
id JSONObject = [NSJSONSerialization JSONObjectWithData: resultData
options: 0
{
category = "Local business";
"category_list" = (
{
id = 153490828039067;
name = "Outdoor Equipment Store";
},
{
id = 186982054657561;
name = "Sports & Recreation";
- (void)viewDidLoad
{
[super viewDidLoad];
//Provided location
CLLocationCoordinate2D zoomLocation;
zoomLocation.latitude = 39.750655;
zoomLocation.longitude= -104.999127;
MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 1000, 1000);
@casspangell
casspangell / tel.m
Created January 18, 2013 18:52
Return to app after opening Tel app
UIWebView *callWebview = [[UIWebView alloc] init];
NSURL *telURL = [NSURL URLWithString:@"tel:number-to-call"];
[callWebview loadRequest:[NSURLRequest requestWithURL:telURL]];
@casspangell
casspangell / file.h
Created December 12, 2012 23:33
Dynamic Keyboards and Views ObjC
#import <UIKit/UIKit.h>
@interface SignUpViewController : UIViewController <UITextFieldDelegate> {
BOOL isLastTextField;
CGFloat adjustmentOffset;
CGFloat mainViewHeight;
CGFloat subViewHeight;
CGFloat keyboardY;
//in LocalModel
-(NSDictionary*)getUserAddress
{
NSDictionary* user = [_userDetails objectForKey:@"user"];
return [user objectForKey:@"address"];
}
//call
[[LocalModel sharedInstance] getUserAddress]
@protocol PopUp2Delegate <NSObject>
-(void)displayPopUp2;
-(void)displayTutorialPopUp;
@end
@protocol AddressCreateDelegate <NSObject>
-(void)addressSubmitted:(NSDictionary *)address;
-(void)displayTutorialPopUp;
@end
@casspangell
casspangell / mail.h
Created November 16, 2012 22:09
Email Within App
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
// Add the MFMail Delegate
@interface MailViewController : UIViewController <MFMailComposeViewControllerDelegate>{
}