Note that there are some explanatory texts on larger screens.

plurals
  1. PONSString In AQGridViewCell
    primarykey
    data
    text
    <p>I have an <code>AQGridView</code> set up to display the files in the documents directory along with 4 other documents that are predefined and loaded into the table at startup. I need to know how I can set the cell to hold the URL of the document (yes, even the predefined ones! They are all just <code>NSStrings</code> after all.) so it can be called later with </p> <pre><code>- (void)gridView:(AQGridView *)gridView didSelectItemAtIndex:(NSUInteger)index { NSString *fileURL = [self._icons objectAtIndex:index]; // do stuff } </code></pre> <p>and loaded into a new view with a custom <code>-(id)init</code> method. Right now, an <code>NSLog</code> of a documents directory object cell returns a <code>(NULL)</code>, and <code>SIGABRT</code>'s in the log.</p> <hr> <p>OK, bounty is up. I assume this means I can demand a little quality. Code snippets would be great! </p> <p>Code available on request.</p> <p>EDIT WORKING CODE:</p> <pre><code>//.h NSMutableArray *_documentIconsURLs; //.m //viewDidLoad // array for internal and external document URLs self._documentIconsURLs = [NSMutableArray array]; _documentIconsURLs = [[NSMutableArray alloc] initWithObjects:@"Musette.pdf", @"Minore.pdf", @"Cantata.pdf", @"Finalé.pdf", @"divine-comedy-inferno.pdf", nil]; //didSelectObject - (void) gridView:(AQGridView *)gridView didSelectItemAtIndex:(NSUInteger)index { NSLog (@"Selected theArgument=%d\n", index); UIViewController *viewController = [[[UIViewController alloc]init]autorelease]; { //if file is built-in, read from the bundle if (index &lt;= 4) { // first section is our build-in documents NSString *fileURLs = [_documentIconsURLs objectAtIndex:index]; NSLog(@"%@", fileURLs); viewController = [[[viewController alloc]initWithContentURL:fileURLs]autorelease]; } </code></pre>
    singulars
    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