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
NSData *dataJSON; | |
dataJSON=service output; | |
NSArray *arr=[NSJSONSerialization JSONObjectWithData:dataJSON options:kNilOptions error:&jsonParsingError]; | |
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
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:ObjcObject options:NSJSONWritingPrettyPrinted error:&writeError]; | |
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; |
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
//header | |
@interface NSString (UrlEncode) | |
- (NSString *)urlencode; | |
@end | |
//implementation | |
#import "NSString+UrlEncode.h" |
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
//Header | |
#import <UIKit/UIKit.h> | |
#import <QuartzCore/QuartzCore.h> | |
#import "NSString+UrlEncode.h" | |
@interface CommonFunctions:NSObject | |
+(void)MakeIOS6StyleStatusBar:(UIView*)vu; | |
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
//Header | |
#import <Foundation/Foundation.h> | |
#import "CoreLocation/CoreLocation.h" | |
@interface GeoLocation : NSObject<CLLocationManagerDelegate,UIAlertViewDelegate> | |
{ | |
CLLocationManager *locationManager; | |
double latitude; | |
double longitude; | |
} |
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
//header | |
@interface MKAnnotation : NSObject<MKAnnotation> | |
@property (strong, nonatomic) NSString *title; | |
@property (strong, nonatomic) NSString *subtitle; | |
@property (nonatomic,assign) CLLocationCoordinate2D coordinate; | |
-(id) initWithCoordinate:(CLLocationCoordinate2D)Coordinate title:(NSString *)Title andsubTitle:(NSString*)Subtitle; | |
@end | |
//implementation |
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)MarkMapwithLat:(NSString*)lat withLong:(NSString*)longi | |
{ | |
NSLog(@"Latitude:%@ Longitude:%@",lat,longi); | |
CLLocationCoordinate2D coord=CLLocationCoordinate2DMake(lat.floatValue,longi.floatValue); | |
MKAnnotation *annotation=[[MKAnnotation alloc]initWithCoordinate:coord title:self.Name andsubTitle:customerSnippet]; | |
MKCoordinateRegion viewRegion=MKCoordinateRegionMakeWithDistance(coord,500,500); | |
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
#!/bin/bash | |
# https://gist.github.com/949831 | |
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/ | |
# command line OTA distribution references and examples | |
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson | |
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution | |
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/ | |
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html |
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
//SFHFKeychainUtils.h | |
#import <UIKit/UIKit.h> | |
@interface SFHFKeychainUtils : NSObject { | |
} | |
+ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error; | |
+ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error; |
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
CFUUID | |
CFUUID is available from iOS 2.0. CoreFoundation package (C style API) provide CFUUID. CFUUIDCreate is the method to create the CFUUIDRef and can get an NSString representation of the created CFUUIDRef like :- | |
CFUUIDRef cfuuid = CFUUIDCreate(kCFAllocatorDefault); | |
NSString *cfuuidString = (NSString*)CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault, cfuuid)); | |
CFUUID is not persisted, every time you call CFUUIDCreate and will get new unique identifier. | |
e.g. 68883Q11-4D23-5434-9D60-2250E4C90967 |