Monday 30 April 2012

show HUD as activity indicator and run main thread

HUD= [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
    [self sendRequesToFBForGettingMyData];


remove where all request will complete. [HUD remove from superview];
I add it to window because that time I want interaction disable.

Thursday 26 April 2012

know which cell is selected when button clicked in cell and load that perticular cell

    UITableViewCell *clickedCell = (UITableViewCell *)[[sender superview] superview];
    NSIndexPath *indexPath = [tblMyCard indexPathForCell:clickedCell];
    int section = indexPath.section;
    int row = indexPath.row;


// code for load particular cell in table
NSArray *indexPathArray = [[NSArray alloc] initWithObjects:indexPath, nil];
[tableView reloadRowsAtIndexPaths:indexPathArray withRowAnimation:UITableViewRowAnimationFade];

Wednesday 25 April 2012

get UDID of iphone device

#define UDID [[UIDevice currentDevice] uniqueIdentifier]  

it returns  a NSString* object . Should define in Congif file

Friday 20 April 2012

Run Loop and lazy loading example UITableView

NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:self.urlString]];
NSURLConnection *con = [[NSURLConnection alloc]
                                    initWithRequest:req
                                    delegate:self
                                    startImmediately:NO];
 [con scheduleInRunLoop:[NSRunLoop currentRunLoop]
                           forMode:NSRunLoopCommonModes];
 [con start];
           

http://iphonedevelopment.blogspot.in/2010/05/downloading-images-for-table-without.html
8:41http://stackoverflow.com/questions/1130089/lazy-load-images-in-uitableview

Thursday 19 April 2012

UITextField set image and complete reference

UIImageView * myView = [[ UIImageView  alloc ]  initWithImage :
  [UIImage  imageNamed : @"wordpress.png" ]];
[myTextField  setLeftView :myView];
[ myTextField   setLeftViewMode: UITextFieldViewModeAlways];
[myView release ];

How to vibrate iphone though App

AudioToolbox.framework 
 
#import <AudioToolbox/AudioToolbox.h>
 
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

Image round corner

// UIImage+RoundedCorner.h
// Created by Trevor Harmon on 9/20/09.
// Free for personal or commercial use, with or without modification.
// No warranty is expressed or implied.

// Extends the UIImage class to support making rounded corners
@interface UIImage (RoundedCorner)
- (UIImage *)roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize;
- (UIImage *) normalize;
@end

Tuesday 17 April 2012

Thursday 12 April 2012

Monday 9 April 2012

Get cache image 2

- (UIImage *) getCachedImage: (NSString *) ImageURLString
{

Get Cached image

//image cache
        MyImageView *imgView = [[MyImageView alloc] initWithFrame:CGRectMake(38, 15, 28, 27)];
        [imgView setBackgroundColor:[UIColor clearColor]];
        [imgView addImageFrom:imgURL];
        [cell addSubview:imgView];

String Encoding and decoding in iOS

- (NSString *)stringByURLDecode {