This file contains hidden or 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
| m_BGAPI_SuccessfulInit = m_BGAPI.Initialize(); | |
| if(true == m_BGAPI_SuccessfulInit) | |
| { | |
| m_BGAPI.SetListener(&m_MyAPIListener); | |
| //m_MyAPIListener.m_pBGAPI = &m_BGAPI; | |
| NSArray *documentDirectories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
| NSString *documentDirectory = [documentDirectories objectAtIndex:0]; | |
| m_BGAPI.SetDocumentOutputPath( [documentDirectory UTF8String] ); |
This file contains hidden or 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
| NSString* api_key = [[[NSUserDefaults standardUserDefaults] objectForKey:@"user"]valueForKey:@"api_key"]; | |
| CFUUIDRef uuid; | |
| CFStringRef uuidStr; | |
| uuid = CFUUIDCreate(NULL); | |
| uuidStr = CFUUIDCreateString(NULL, uuid); | |
| NSString* uuidString = [NSString stringWithFormat:@"%@", uuidStr]; | |
| NSDictionary *paramDictionary = [NSDictionary dictionaryWithObject:uuidString forKey:@"token"]; | |
| NSData *params = [NSJSONSerialization dataWithJSONObject:paramDictionary options:NSJSONWritingPrettyPrinted error:NULL]; | |
| id jsonObject = [NSJSONSerialization JSONObjectWithData:params options:0 error:nil]; |
This file contains hidden or 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)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info | |
| { | |
| image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; | |
| image = [[UIImage alloc]initWithCGImage:image.CGImage scale:.25 orientation:UIImageOrientationRight]; | |
| dataObj = UIImageJPEGRepresentation(image, .1); | |
| } |
This file contains hidden or 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
| PFFile *imageFile; | |
| imageFile = [PFFile fileWithName:@"photo.jpg" data:dataObj]; | |
| [imageFile saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { | |
| if (!error) { | |
| PFObject *locationImage = [PFObject objectWithClassName:@"locationImages"]; | |
| [locationImage setObject:imageFile forKey:@"image"]; | |
| [locationImage setObject:[PFUser currentUser] forKey:@"uploadedBy"]; | |
| [locationImage saveEventually]; | |
| if ([mediaType isEqualToString:@"photo"]) { |
This file contains hidden or 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
| if (_prevQuery != _currentPage + 1 && _currentPage + 1 <= _numberOfPages) { | |
| NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; | |
| NSString* api_key = [[defaults objectForKey:@"user"]valueForKey:@"api_key"]; | |
| NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@&per_page=15&page=%d", [[NSUserDefaults standardUserDefaults]objectForKey:@"baseUrl"],currentEndpoint, _currentPage + 1]]; | |
| NSLog(@"%@", url); | |
| NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:30]; | |
| [request setHTTPMethod:@"GET"]; | |
| if (api_key) { | |
| [request setValue:api_key forHTTPHeaderField:@"authorization"]; | |
| } |
This file contains hidden or 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
| - (IBAction)showButtonTapped:(id)sender { | |
| NSMutableDictionary *nutritionPrefs = [[NSUserDefaults standardUserDefaults]objectForKey:@"nutritionPrefs"]; | |
| NSMutableDictionary *cuisinePrefs = [[NSUserDefaults standardUserDefaults]objectForKey:@"cuisinePrefs"]; | |
| NSMutableDictionary *typeOfDishPrefs = [[NSUserDefaults standardUserDefaults]objectForKey:@"typeOfDishPrefs"]; | |
| NSMutableDictionary *ingredientsPrefs = [[NSUserDefaults standardUserDefaults]objectForKey:@"ingredientsPrefs"]; | |
| //Get dining preferences from dictionary and add them to an array | |
| NSMutableArray *diningPrefsArray = [[NSMutableArray alloc]initWithCapacity:1]; | |
| if ([[NSUserDefaults standardUserDefaults]boolForKey:@"DINE IN"]) { | |
| [diningPrefsArray addObject:@"Dine In"]; |
This file contains hidden or 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
| faceDirectionValueLabel.text = @"3.33"; | |
| [faceDirectionValueLabel sizeToFit]; | |
| [faceDirectionValueLabel setFrame:CGRectMake(faceDirectionView.frame.size.width/2 - faceDirectionValueLabel.frame.size.width/2, faceDirectionValueLabel.frame.origin.y, faceDirectionValueLabel.frame.size.width, 47)]; | |
| degreeLabel.frame = CGRectMake(faceDirectionValueLabel.frame.origin.x + faceDirectionValueLabel.frame.size.width - 2, 49, 24, 30); |
This file contains hidden or 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
| //Set picker selection to previously selected range | |
| if ([[zapData objectForKey:@"distanceFilter"]isEqualToString:@"50 Yards"]) { | |
| [settingsPicker selectRow:0 inComponent:0 animated:NO]; | |
| } | |
| else if ([[zapData objectForKey:@"distanceFilter"]isEqualToString:@"100 Yards"]) { | |
| [settingsPicker selectRow:1 inComponent:0 animated:NO]; | |
| } | |
| else if ([[zapData objectForKey:@"distanceFilter"]isEqualToString:@"500 Yards"]) { | |
| [settingsPicker selectRow:2 inComponent:0 animated:NO]; | |
| } |
This file contains hidden or 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)requestFinished:(ASIHTTPRequest *)request { | |
| NSLog(@"Response Status Code: %d", [request responseStatusCode]); | |
| if ([request responseStatusCode] == 200 || [request responseStatusCode] == 201) { | |
| NSLog(@"%@", @"Logged In"); | |
| NSDictionary* user = [NSDictionary dictionaryWithObject:[request responseString] forKey:@"api_key"]; | |
| [[NSUserDefaults standardUserDefaults]setObject:user forKey:@"user"]; | |
| [[NSUserDefaults standardUserDefaults]synchronize]; | |
| } | |
| else { | |
| NSLog(@"%@", @"Not Logged In"); |
This file contains hidden or 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
| [{"name":"Apple\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t11.6\" MacBook Air Notebook Computer","description":"1.8GHz Intel Core i7\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t4GB RAM\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t256GB Flash Storage\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tIntel GMA HD 3000 Graphics\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t11.6\" Glossy Widescreen LED Backlit Display\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tFaceTime Webcam\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tBluetooth 4.0\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t802.11a/b/g/n Wi-Fi\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tMac OS X 10.7 Lion\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t2.4 lb\r\n\t\t\t\t\t\r\n\t\t\t\t","url":"http://www.bhphotovideo.com/c/product/815051-REG/Apple_Z0MG_0002_11_6_MacBook_Air_Notebook.html","image":[{"style":"thumbnail","url":"http://s3.amazonaws.com/zazoola/production/products/images/197/thumbnail.png?1339906598"},{"style":"list_sm","url":"http://s3.amazonaws.com/zazoola/production/products/images/197/list_sm.png?1339906598"},{"style":"list_lg","url":"http://s3.amazonaws.com/zazoola/production/products/images/197 |