Iphone App crashing on launch - objective-c

My simple iphone app is crashing on launch, it says "the application downloadText quit unexcpectedly" None of these windows that pop up when a mac app crashes and has a send to Apple button. My .h is below and I would greatly appreciate it if anyone could give me a hand as to what's wrong?
#import "downloadTextViewController.h"
#implementation downloadTextViewController
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
NSString *myPath = [self saveFilePath];
NSLog(myPath);
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:myPath];
if (fileExists)
{
NSArray *values = [[NSArray alloc] initWithContentsOfFile:myPath];
textView.text = [values objectAtIndex:0];
[values release];
}
// notification
UIApplication *myApp = [UIApplication sharedApplication];
// add yourself to the dispatch table
[[NSNotificationCenter defaultCenter] addObserver:self
selector:#selector(applicationWillTerminate:)
name:UIApplicationWillTerminateNotification
object:myApp];
[super viewDidLoad];
}
- (IBAction)fetchData {
/// Show activityIndicator / progressView
NSURLRequest *downloadRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:#"http://simpsonatyapps.com/exampletext.txt"]
cachePolicy:NSURLRequestReloadIgnoringCacheData
timeoutInterval:1.0];
NSURLConnection *downloadConnection = [[NSURLConnection alloc] initWithRequest:downloadRequest delegate:self];
if (downloadConnection)
downloadedData = [[NSMutableData data] retain];
else {
/// Error message
}
}
- (void)connection:(NSURLConnection *)downloadConnection didReceiveData:(NSData *)data {
[downloadedData appendData:data];
NSString *file = [[NSString alloc] initWithData:downloadedData encoding:NSUTF8StringEncoding];
textView.text = file;
/// Remove activityIndicator / progressView
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
}
- (NSString *) saveFilePath
{
NSArray *pathArray =
NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
return [[pathArray objectAtIndex:0] stringByAppendingPathComponent:#"savedddata.plist"];
}
- (void)applicationWillTerminate:(UIApplication *)application {
NSArray *values = [[NSArray alloc] initWithObjects:textView.text,nil];
[values writeToFile:[self saveFilePath] atomically:YES];
[values release];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
- (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse {
return nil;
}
#end
Edit:
The console comes up with:
21/03/10 2:32:19 PM downloadText[3548] Stack:
( 8307803, 2474450491, 8466881, 2787944, 2786485, 25429108, 8210735, 25423659,
25431927, 24117515, 24111079, 24110797, 8337, 23594443, 23632310, 23620404,
23602815, 23629921, 134489, 8092544, 8088648, 23596565, 23633839, 8252 )

Check the Console for exception reports. [Spotlight search for "Console" application if you're lazy. ;-] Any stack trace there to provide clues?
Run in the simulator in debug mode. Set a breakpoint at the start of viewDidLoad, plus anywhere in your code from any stack trace left in the Console.
Does putting the call to "[super viewDidLoad]" first (instead of last) help? If that's doing any work, it might be tripping up your viewDidLoad. Check the Console output first though -- I tend to make code changes only when I understand what's going wrong, or I can use it to rule out potential causes.

Related

watch os 2 not waking parent app and changing UITableView of parent

I have a watch app that is being updated for watch os 2. The sendmessage does not wake the parent app. According to the transition documentation is this how you would wake a parent in the background.
"The iOS app is always considered reachable, and calling this method from your Watch app wakes up the iOS app in the background as needed."
Has anyone had this problem? The only way to get data is to have the parent app already open.
Another weird thing is the watch app changes the uitableview for the parent app. When the -(IBAction)yesterdaySales:(id)sender is called on the watch, it changes the parent app UITableView instead of the watch tableview.
InterfaceController.m
#import "InterfaceController.h"
#import "MyRowController.h"
#import "ftDateParser.h"
#import WatchKit;
#import <WatchConnectivity/WatchConnectivity.h>
#interface InterfaceController() <WCSessionDelegate>
{
IBOutlet WKInterfaceDevice *it;
BOOL tday;
IBOutlet WKInterfaceLabel *lblCompany;
}
#end
#implementation InterfaceController
#synthesize myTable = _myTable;
- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
// Configure interface objects here.
if([WCSession isSupported]){
WCSession *session = [WCSession defaultSession];
session.delegate = self;
[session activateSession];
}
//[self requestInfoPhone];
[self getToday];
}
- (void)willActivate {
// This method is called when watch view controller is about to be visible to user
[super willActivate];
}
- (void)didDeactivate {
// This method is called when watch view controller is no longer visible
[super didDeactivate];
}
-(void)requestInfoPhone{
NSDictionary *dic = #{#"request":#"ySales"};
[[WCSession defaultSession] sendMessage:dic
replyHandler:^(NSDictionary *replyInfo){
NSLog(#"The Reply: %#", replyInfo);
NSDictionary *location = replyInfo;
NSString *name = location[#"label"];
NSString *totalSales = location[#"totalSales"];
// NSString *test2 = location[#"rowText"];
NSMutableArray *sales = [[NSMutableArray alloc]init];
NSMutableArray *storeNames = [[NSMutableArray alloc]init];
sales = location[#"rowText"];
storeNames = location[#"storeNames"];
[self loadTable:sales names:storeNames company:name];
[_labelName setText:name];
[_labelTotalSales setText:totalSales];
tday = YES;
}
errorHandler:^(NSError *error){
NSLog(#"%#", error);
}
];
}
-(void)loadTable:(NSMutableArray*)tester names:(NSMutableArray*)names company:(NSString *)company{
[_myTable setNumberOfRows:[tester count] withRowType:#"row"];
[_labelName setText:company];
for (int i = 0; i < [tester count]; i++) {
MyRowController *vc = [_myTable rowControllerAtIndex:i];
[vc.testLabel setText:[ftDateParser currencyFormat: tester[i]]];
[vc.nameLabel setText:[ftDateParser parseName:names[i]]];
}
[_myTable scrollToRowAtIndex:(0)];
}
-(IBAction)yesterdaySales:(id)sender{
if (tday) {
[_ydaySales setTitle:#"Today Sales"];
[self requestInfoPhone];
}
else{
[_ydaySales setTitle:#"Yesterday Sales"];
[self getToday];
}
}
-(void)getToday{
NSDictionary *dic = #{#"request":#"todaySales"};
[[WCSession defaultSession] sendMessage:dic
replyHandler:^(NSDictionary *replyInfo){
NSDictionary *location = replyInfo;
NSString *name = location[#"label"];
NSString *totalSales = location[#"totalSales"];
// NSString *test2 = location[#"rowText"];
NSMutableArray *sales = [[NSMutableArray alloc]init];
NSMutableArray *storeNames = [[NSMutableArray alloc]init];
sales = location[#"rowText"];
storeNames = location[#"storeNames"];
[self loadTable:sales names:storeNames company:name];
[_labelName setText:name];
[_labelTotalSales setText:totalSales];
tday = YES;
}
errorHandler:^(NSError *error){
NSLog(#"%#", error);
}
];
}
#end
Parent.m
-(void)setUpAppForWatch{
done = NO;
if([WCSession isSupported]){
WCSession *session = [WCSession defaultSession];
session.delegate = self;
[session activateSession];
}
}
-(void)session:(WCSession *)session didReceiveMessage:(NSDictionary<NSString *,id> *)message replyHandler:(void (^)(NSDictionary<NSString *,id> * _Nonnull))replyHandler{
/*UIApplication *application = [UIApplication sharedApplication];
__block UIBackgroundTaskIdentifier identifier = UIBackgroundTaskInvalid;
dispatch_block_t endBlock = ^ {
if (identifier != UIBackgroundTaskInvalid) {
[application endBackgroundTask:identifier];
}
identifier = UIBackgroundTaskInvalid;
};
identifier = [application beginBackgroundTaskWithExpirationHandler:endBlock];*/
[self setUpAppForWatch];
[self getTheDate];
startDate = todayDay;
endDate = tomorrow;
//[self getTodaySalesforWatch];
NSString *currency = [ftDateParser currencyFormat:totalSales];
NSDictionary *dic = #{#"label": [NSString stringWithFormat:#"%#", #"Town Crier, Inc."],
#"totalSales": currency,
#"rowText": storeSalesData,//[NSString stringWithFormat:#"%#", currency]
#"storeNames":storeNames
};
NSString *request = [message objectForKey:#"request"];
if ([request isEqualToString:#"todaySales"]) {
[self getTodaySalesforWatch];
}
else if ([request isEqualToString:#"ySales"]){
[self connectToWebService];
}
if (done) {
replyHandler(dic);
}
}
Edit:
Maybe the changes to the parent app were happening before, but I didn't know cause the app was running in the background. Still can't get it to wake the parent app.
You don't link to the source of the quote at the top of your question but it must be referring to the openParentApplication method of WatchKit 1. Devices running WatchOS 2.0 cannot call openParentApplication.
The method you're implementing in the code in your question is for a WCSession, which only works for immediate communication between a WatchKit app extension and an iOS app that are both running at the same time. This method does not cause your iOS app to launch, neither in the background nor in the foreground. Other asynchronous communication methods must be used if both apps are not running at the time.

variable becomes nil in numberOfRowsInTableView after being set in another method

My class looks like this :
#interface ApplicantPickerController : AppPage <NSTableViewDataSource, NSTableViewDelegate>
{
School *school;
__weak IBOutlet NSTableView *tableView;
NSMutableArray *familyList;
__weak IBOutlet NSProgressIndicator *progressIndicator;
}
- (IBAction)alphabetButtonPressed:(id)sender;
#end
In the alphabetButtonPressed method, I'm fetching a json array from a webservice and assigning it to familyList. After doing this, I do [tableView reload];
When the control passes to the - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView method, familyList becomes nil. Why is this happening and how can I fix it?
I'm using ARC for this project.
Cocoa/Objective-C newbie here. Any help would be much appreciated. Thank you!
Updated - Here is the implementation of the class :
#interface ApplicantPickerController ()
#end
#implementation ApplicantPickerController
- (IBAction)alphabetButtonPressed:(id)sender {
[progressIndicator startAnimation:self];
NSString * addy = [[NSString alloc] initWithFormat:#"%#.php?function=applicant_lookup&schoolID=%#&alpha=%#&currentYear=%#&format=json", BASE_URL_SCHOOL, school->recordID, [sender title], school->CurrentYear];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:addy]];
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
if(data) {
//NSString * resp = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSError *error = nil;
NSObject *json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];
if([json isKindOfClass:[NSDictionary class]])
{
familyList = nil;
[tableView reloadData];
}
else if ([json isKindOfClass:[NSArray class]])
{
familyList = [[NSMutableArray alloc] init];
[familyList addObjectsFromArray:(NSArray*)json];
//[_familyList retain];
[tableView reloadData];
}
[progressIndicator stopAnimation:self];
}
}];
}
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
return [familyList count];
}
- (id)initWithMainView:(NSView *)_theView AndMainController:(NSViewController *)_theViewController AndNibName:(NSString *)nibName AndArgs:(NSArray *)_args
{
self = [super initWithMainView:_theView AndMainController:_theViewController AndNibName:nibName AndArgs:_args];
school = [args objectAtIndex:0];
return self;
}
#end
I don't know if I discovered a bug by apple, but following is how I solved this issue.
I was setting the NSTableView delegate and datasource in the UI builder (by right clicking and making the connections with the mouse). For some reason, if I set the delegate and dataSource in the code (specifically in the awakeFromNib method), the issue gets resolved.
- (void)awakeFromNib {
tableView.delegate = self;
tableView.dataSource = self;
}

svprogresshud not showing in xcode5 ios7

I am trying to use SVProgressHUD with cocoapods. I have install it in my xcode workspace following numerous tutorials online. It seems simple enough to use, but I cannot get it to work. Here my code to load data from rottentomatoes app. I want to show "loading" while the network request is doing its thing. I am wondering if this is ui thread issue ? I added a sleep inside the network request because the results were coming back too fast !
- (void) reload{
[SVProgressHUD showWithStatus:#"Updating" maskType:SVProgressHUDMaskTypeBlack];
NSString *url = #"http://api.rottentomatoes.com/api/public/v1.0/lists/dvds/top_rentals.json?";
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
[NSThread sleepForTimeInterval:3];
NSDictionary *object = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSMutableArray *array = [[NSMutableArray alloc]initWithArray:[object objectForKey:#"movies"]];
self.movies = [[NSMutableArray alloc]init];
for(NSDictionary *item in array){
SFMovie *movie = [[SFMovie alloc]initWithDictionary:item];
[self.movies addObject:movie];
}
[SVProgressHUD dismiss];
[self.tableView reloadData];
}];
}
EDIT for comment:
The reload is called on both init methods (since I am using storyboard for this project)
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
[self reload];
}
return self;
}
- (id) initWithCoder:(NSCoder *)aDecoder{
self = [super initWithCoder:aDecoder];
if(self){
[self reload];
}
return self;
}
Second EDIT:
I added a pull down to refresh and the "updating ..." shows up when I pull the tableview down. But it does not show up on init.
- (void)viewDidLoad
{
[super viewDidLoad];
UIRefreshControl *refreshControl = [UIRefreshControl new];
[refreshControl addTarget:self action:#selector(refresh:) forControlEvents:UIControlEventValueChanged];
refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:#"Pull to refresh..."];
self.refreshControl = refreshControl;
}
- (void)refresh:(UIRefreshControl *)sender{
[self reload];
[sender endRefreshing];
}
So I guess I cannot run UI stuff on init methods as the view is not ready. I am now calling the reload method on viewdidload and it works file. Thank you John !
In any init methods, messing with the view hierarchy is tricky business -- keep that logic in viewDidLoad to avoid any of those modifications from being wiped (especially from storyboard initialization).

Reloading a table view after NSURLConnection succeeds

I'm new to Xcode, so bear with me:
I have a table view that I'm trying to reload once the NSURLConnection succeeds. I have a number of messages that help me guide me along the way... but when I call the reload upon the table view, the table doesn't repopulate.
JsonViewController.h:
#import <UIKit/UIKit.h>
#interface JsonViewController : UITableViewController {
NSMutableArray *theTweets;
IBOutlet UITableView *tview;
NSMutableData *responseData;
}
#property (nonatomic, retain) NSMutableArray *theTweets;
#property (nonatomic, retain) UITableView *tview;
#end
JsonViewController.m:
#import "JsonViewController.h"
#import "SBJson.h"
#implementation JsonViewController
#synthesize theTweets;
#synthesize tview;
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void) dealloc {
[theTweets release];
[super dealloc];
}
- (NSMutableArray*)theTweets {
return [[theTweets retain] autorelease];
}
- (void) setTheTweets:(NSMutableArray *)newTweets {
if (newTweets != theTweets) {
[newTweets retain];
[theTweets release];
theTweets = newTweets;
NSLog(#"Setting new tweets...");
[tview reloadData];
}
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
tview.delegate = self;
responseData = [[NSMutableData data] retain];
theTweets = [NSMutableArray array];
NSURLRequest *request = [NSURLRequest requestWithURL:
[NSURL URLWithString:#"http://search.twitter.com/search.json?q=AriaPoker&result_type=recent"]];
[[NSURLConnection alloc] initWithRequest: request delegate:self];
NSLog(#"Trying to get feed upon initialization");
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
// methods that are not important
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
NSLog(#"Number of the tweets count at this point: %d", [theTweets count]);
return [theTweets count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
NSLog(#"Number of the tweets count at this point: %d", [theTweets count]);
// Configure the cell...
NSDictionary *aTweet = [theTweets objectAtIndex:[indexPath row]];
//cell.textLabel.text = [aTweet objectForKey:#"text"];
cell.textLabel.adjustsFontSizeToFitWidth = YES;
cell.textLabel.font = [UIFont systemFontOfSize:12];
cell.textLabel.numberOfLines = 4;
cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.textLabel.text = #"Test";
cell.detailTextLabel.text = #"haha";
//NSURL *url = [NSURL URLWithString:[aTweet objectForKey:#"profile_image_url"]];
//NSData *data = [NSData dataWithContentsOfURL:url];
//cell.imageView.image = [UIImage imageWithData:data];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
NSLog(#"Loading cells in table");
}
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
}
#pragma mark NSURLConnection Delegate Methods
- (void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
[responseData setLength:0];
}
- (void) connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[responseData appendData:data];
}
- (void) connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
//do nothing
NSLog(#"A connection error has occurred!");
}
- (void) connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
[responseData release];
NSDictionary *results = [[responseString JSONValue] retain];
NSLog(#"Number of Rows: %d", [results count]);
NSMutableArray *allTweets = [results objectForKey:#"results"];
//[viewController setTweets:allTweets];
theTweets = allTweets;
NSLog(#"Number of misc2: %d", [theTweets count]);
[results release];
[tview reloadData];
}
#end
I'm wondering what I'm doing wrong here.
In connectionDidFinishLoading change from this:
theTweets = allTweets;
to this:
self.theTweets = allTweets;
or this way if you prefer:
[self setTheTweets:allTweets];
You weren't invoking the setter method, so it wasn't getting retained.
As suggested by progrmr try to call the setter method, or simply change definition of theTweets property to #dynamic theTweets in this case when you try to set property, the custom setter method will be called.

Async Image download a UITableView's cellForRowAtIndexPath not always called

I using Apple's LazyTableImages sample to async download images for UITableViewCells. The main difference is that I'm saving a copy of the file to the Documents folder so that it doesn't need to be downloaded all the time. The method below is called by the class responsible for downloading the image
- (void)imageDidLoad:(NSIndexPath *)indexPath
{
AsyncImage *aImage = [imageDownloadsInProgress objectForKey:indexPath];
if (aImage != nil)
{
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:aImage.indexPathInTableView];
cell.imageView.image = aImage.image;
}
}
When the image is not on the device, the download goes fine and the image is displayed. However when the image is on the device the image is not displayed and the cell variable is null.
The code for the AsyncImage is:
//
// AsyncImgView.m
// BelfastChamberOfCommerce
//
// Created by markpirvine on 23/06/2011.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "AsyncImage.h"
#import "AppManager.h"
#define kAppIconHeight 48
#interface AsyncImage ()
#property (nonatomic, retain) NSString *fileUrl;
#end
#implementation AsyncImage
#synthesize imageUrl, fileUrl;
#synthesize image;
#synthesize indexPathInTableView;
#synthesize delegate;
- (void)dealloc
{
[imageUrl release];
[fileUrl release];
[image release];
[indexPathInTableView release];
[connection cancel];
[connection release];
[data release];
[super dealloc];
}
- (void)loadImage
{
if (connection != nil)
{
[connection release];
}
if (data != nil)
{
[data release];
}
if([self.imageUrl length] > 0)
{
self.fileUrl = [[[AppManager sharedInstance] getCacheLocation] stringByAppendingPathComponent:[[self.imageUrl componentsSeparatedByString:#"/"] lastObject]];
if([[NSFileManager defaultManager] fileExistsAtPath:self.fileUrl] == YES)
{
self.image = [UIImage imageWithContentsOfFile:self.fileUrl];
[self deliverImage];
}
else
{
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.imageUrl] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
}
}
}
- (void)connection:(NSURLConnection *)theConnection didReceiveData:(NSData *)incrementalData
{
if (data == nil)
{
data = [[NSMutableData alloc] initWithCapacity:2048];
}
[data appendData:incrementalData];
}
- (void)connectionDidFinishLoading:(NSURLConnection*)theConnection
{
[connection release];
connection = nil;
UIImage *iTmp = [[UIImage alloc] initWithData:data];
if (iTmp.size.width != kAppIconHeight && iTmp.size.height != kAppIconHeight)
{
CGSize itemSize = CGSizeMake(kAppIconHeight, kAppIconHeight);
UIGraphicsBeginImageContext(itemSize);
CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);
[iTmp drawInRect:imageRect];
self.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
else
{
self.image = iTmp;
}
[UIImageJPEGRepresentation(self.image, 1.0) writeToFile:self.fileUrl atomically:YES];
[iTmp release];
[data release];
data = nil;
[self deliverImage];
}
- (void)deliverImage
{
[delegate imageDidLoad:self.indexPathInTableView];
}
- (void)cancelDownload
{
[connection cancel];
connection = nil;
data = nil;
}
#end
Any help would be greatly appreciated
I suggest using one of the open source classes for async download of images that has built-in support for caching. The one that I'm using is cached image for iOS.