Skip to content

Instantly share code, notes, and snippets.

@Krishna-666
Krishna-666 / Custom Cell
Created February 23, 2012 06:06
Table view custom cell
//Custom Cell.h
@interface CustomCell : UITableViewCell {
UITextField *textField;
UILabel *label;
UIButton *btn;
UISlider *objSlider;
}
@property (nonatomic, retain) IBOutlet UITextField *textField;
@property (nonatomic, retain) IBOutlet UILabel *label;
@Krishna-666
Krishna-666 / gist:1852057
Created February 17, 2012 09:09
Call webservice
#pragma mark -
#pragma mark Webservice Methods
-(void)CallWebservice {
appdelegate=(WeirdoAppDelegate *)[[UIApplication sharedApplication]delegate];
if(isPhotoDetail) {
[AlertView ShowAlert];
NSString *soapMsg = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
"<soap:Body>\n"
"<GetPhotoDetailForiPhone xmlns=\"http://www.weirdo.com/\">\n"
@Krishna-666
Krishna-666 / gist:1852007
Created February 17, 2012 08:58
Location
//
// Location.h
// CoolBook
//
// Created by iphone on 27/08/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#pragma mark Plist path Create
-(void)CreatePlistPath
{
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
path = [[documentsDirectory stringByAppendingPathComponent:@"data.plist"] retain];
@Krishna-666
Krishna-666 / gist:1851939
Created February 17, 2012 08:49
Database
#import <sqlite3.h>
Framework libsqlite3.0dylib
#praga mark establish the path of database
- (NSString *) getDBPath {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
NSString *documentsDir = [paths objectAtIndex:0];
return [documentsDir stringByAppendingPathComponent:@"Expense.sqlite"];
}
- (void) copyDatabaseIfNeeded {
@Krishna-666
Krishna-666 / ImageOfView
Created February 7, 2012 05:16
get Image From View iPhone
+(UIImageView *)ImageOfView:(UIView *)viewImage
{
UIImageView *returnView = [[UIImageView alloc] initWithFrame:[viewImage frame]];
[returnView setBackgroundColor:[UIColor clearColor]];
UIGraphicsBeginImageContext(viewImage.bounds.size);
[viewImage.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *Image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();