Note that there are some explanatory texts on larger screens.

plurals
  1. PO@property scope issues and memory problems
    primarykey
    data
    text
    <p>I am having a crash I do not understand. I am downloading a couple files from a remote server, and when a file has finished downloading, I am attempting to retrieve an object that was attached to the request object. </p> <p>Tia for any help!</p> <p>S.</p> <p><strong>Main Class</strong> </p> <pre><code>for (TrainingEntry* _entry in objects) { HTTPRequest * request = [HTTPRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", [[ConfigLoader config] objectForKey:@"Server"], _entry.url]]]; [request setDownloadDestinationPath:[NSString stringWithFormat:@"%@/%@", documentsDirectoryPath, _entry.filename]]; [request setEntry:_entry]; [request setRaw:_entry.title]; TrainingEntry * test = (TrainingEntry*)[request _entry]; NSLog(@"title: %@", [test title]); //&lt;= This works NSLog(@"filename: %@", [test filename]); //&lt;= This works [[self networkQueue] addOperation:request]; } // Start Queue [[self networkQueue] go]; ... - (void)requestFinished:(HTTPRequest *)request { if ([[self networkQueue] requestsCount] == 0) { [self setNetworkQueue:nil]; } NSLog(@"req: %@", [request raw]); NSLog(@"title: %@", [[request entry] title]); // &lt;= This works NSLog(@"filename: %@", [[request entry] filename]); // &lt;= This crashes } </code></pre> <p><strong>HTTPRequest Object</strong> </p> <pre><code>@interface HTTPRequest : ASIHTTPRequest { } @property (nonatomic, retain) TrainingEntry * entry; @property (nonatomic, retain) NSString * raw; @end </code></pre> <p><strong>TrainingEntry Class</strong> </p> <pre><code>@interface TrainingEntry : NSObject { NSString * title; NSString * filename; } @property (nonatomic, retain) NSString * title; @property (nonatomic, retain) NSString * filename; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload