Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are a bunch of problems with this code, any of which might cause a crash. Hard to tell which without seeing a backtrace.</p> <ol> <li><p>your initializer is wrong:</p> <pre><code>- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake(40,38,240,203)]; .... return self; } </code></pre> <p>You shouldn't have <em>any</em> code between the if and the return. What happens if the call to super fails? In your code, that'll go on to initialize the instance anyway. That'll break, for sure.</p></li> <li><p>Your call to NSLog() is dangerous:</p> <pre><code>NSLog(soapMessage); </code></pre> <p>If <code>soapMessage</code> were to happen to contain a <code>%@</code> or <code>%s</code>, that is guaranteed to crash.</p></li> <li><p>You are invoking <code>-dealloc</code> directly. Twice. Immediately after adding the object to be deallocated to the view hierarchy.</p> <pre><code>[[self view] addSubview:tableView1]; [tableView1 dealloc]; [[self view] addSubview:img]; [img dealloc]; </code></pre> <p>This will definitely cause a crash as the deallocated objects are now sitting in the view hierarchy. As soon as your app tries to render anything, ***BOOM****.</p> <p>You should <em>never</em> call <code>-dealloc</code> directly. (You meant <code>-release</code> there, right?)</p></li> <li><p>In a comment, you say the crash is on the line <code>DetailImageViewDataSource *detail=[[DetailImageViewDataSource alloc] init];</code>. That line doesn't appear in the pasted source. As well, all of your initialization logic is in <code>-initWithNibName:bundle:</code>.</p> <p>Are you sure your objects are being initialized correctly?</p></li> </ol> <p>Fix all of that and then see if your crash still happens. If it does, post the stacktrace of the crash.</p>
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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