Thursday 1 October 2015

How To Lazy Loading Images UIImages in Ios /Iphone

 
 
 
NSMutableDictionary *Dict_name;
BOOL isDragging_msg, isDecliring_msg;

Now In Class.m file, put this code in view did load:
Dict_name = [[NSMutableDictionary alloc] init];
 
 
 
if ([dicImages_msg valueForKey:[[msg_array objectAtIndex:indexPath.row] valueForKey:@"image name or image link"]]) { 
    cell.image_profile.image=[dicImages_msg valueForKey:[[msg_array objectAtIndex:indexPath.row] valueForKey:@"image name or image link"]];
}
else
{
    if (!isDragging_msg && !isDecliring_msg)
    {
        [dicImages_msg setObject:[UIImage imageNamed:@"Placeholder.png"] forKey:[[msg_array objectAtIndex:indexPath.row] valueForKey:@"image name or image link"]];
        [self performSelectorInBackground:@selector(downloadImage_3:) withObject:indexPath];
    }
    else
    {
        cell.image_profile.image=[UIImage imageNamed:@"Placeholder.png"];
    }
}
#import<UIKit/UIKit.h> #import<CoreLocation/CoreLocation.h> @interfaceViewController : UIViewController CLLocationManager *locationManager; @end - See more at: http://www.theappguruz.com/blog/using-gps-device-get-current-location-ios#sthash.uD46QbkP.dpuf
  • #import<UIKit/UIKit.h>
  • #import<CoreLocation/CoreLocation.h>
  • @interfaceViewController : UIViewController
  • CLLocationManager *locationManager;
  • @end
  • - See more at: http://www.theappguruz.com/blog/using-gps-device-get-current-location-ios#sthash.uD46QbkP.dpuf
  • #import<UIKit/UIKit.h>
  • #import<CoreLocation/CoreLocation.h>
  • @interfaceViewController : UIViewController
  • CLLocationManager *locationManager;
  • @end
  • - See more at: http://www.theappguruz.com/blog/using-gps-device-get-current-location-ios#sthash.uD46QbkP.dpuf
  • #import<UIKit/UIKit.h>
  • #import<CoreLocation/CoreLocation.h>
  • @interfaceViewController : UIViewController
  • CLLocationManager *locationManager;
  • @end
  • - See more at: http://www.theappguruz.com/blog/using-gps-device-get-current-location-ios#sthash.uD46QbkP.dpuf
  • #import<UIKit/UIKit.h>
  • #import<CoreLocation/CoreLocation.h>
  • @interfaceViewController : UIViewController
  • CLLocationManager *locationManager;
  • @end
  • - See more at: http://www.theappguruz.com/blog/using-gps-device-get-current-location-ios#sthash.uD46QbkP.dpuf
  • #import<UIKit/UIKit.h>
  • #import<CoreLocation/CoreLocation.h>
  • @interfaceViewController : UIViewController
  • CLLocationManager *locationManager;
  • @end
  • - See more at: http://www.theappguruz.com/blog/using-gps-device-get-current-location-ios#sthash.uD46QbkP.dpuf
  • #import<UIKit/UIKit.h>
  • #import<CoreLocation/CoreLocation.h>
  • @interfaceViewController : UIViewController
  • CLLocationManager *locationManager;
  • @end
  • - See more at: http://www.theappguruz.com/blog/using-gps-device-get-current-location-ios#sthash.uD46QbkP.dpuf
  • #import<UIKit/UIKit.h>
  • #import<CoreLocation/CoreLocation.h>
  • @interfaceViewController : UIViewController
  • CLLocationManager *locationManager;
  • @end
  • - See more at: http://www.theappguruz.com/blog/using-gps-device-get-current-location-ios#sthash.uD46QbkP.dpuf
  • #import<UIKit/UIKit.h>
  • #import<CoreLocation/CoreLocation.h>
  • @interfaceViewController : UIViewController
  • CLLocationManager *locationManager;
  • @end
  • - See more at: http://www.theappguruz.com/blog/using-gps-device-get-current-location-ios#sthash.uD46QbkP.dpuf