Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First off, unless you are doing something special with your instance variable (relImageUrl) get rid of it as it isn't needed. If you keep it, make sure you synthesize it properly -- and current convention is to prefix it with an underscore (as in _relImageUrl). But again, you probably don't need it at all.</p> <p>You haven't shown anything of the getter/setter for relImageUrl so assuming you aren't doing anything special there. </p> <p>You also show your private class interface as GDAPIhandler but you refer to it as dataClass.h -- this makes no sense. </p> <p>How do you set the item count for table view if you don't actually add any elements until you request it as above?</p> <p>Ideally, you'd have an NSArray property in your custom class and methods that operate on it by exposing:</p> <ol> <li>a method to get the count of items </li> <li>a method to pull out an item an a given index </li> <li>possibly methods to add/remove items</li> <li>methods to instantiate/populate the array -- but please don't do it as you request cells as you seem to be doing.....that approach will not end well</li> </ol> <p>All this assumes you are trying to use your custom class to 'hide' access to the underlying array. Suggest you refactor along some of these lines to make things easier for yourself going forward.</p> <p>UPDATE</p> <p>I just saw your screen shot for the last response. Not sure how you expect folks to help when you don't share all the relevant info.</p> <p>If you want to assign to relImageUrl inside a block, you need to prefix it with the __block storage modifier. Further, don't refer to self inside the block as it could lead to retain cycles.</p> <p>So, you could try something like (inside your function but before you enter any blocks).</p> <pre><code>__weak CustomClass* weakSelf = self; // don't capture self in block __block NSMutableArray* weakImageUrl = weakSelf.relImageUrl; </code></pre> <p>..try something along those lines. Two main points again:</p> <ol> <li>don't refer to self inside the block</li> <li>use __block storage modifier for any objects you need to mutate inside the block</li> </ol> <p>...good luck...</p>
    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.
    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