in Education by
I receive a SIGABRT when I try to get a non-null variable. Code: NSLog(@"%@", appDelegate.xmlData.magDictionary); for (Magazine *ibb in appDelegate.xmlData.magDictionary) { NSLog(@"%@", [ibb title]); } Output: { 1 = ""; 2 = ""; 3 = ""; 4 = ""; 5 = ""; 6 = ""; 7 = ""; 8 = ""; } and SIGABRT on NSLog(@"%@", [ibb title]); The Magazine model: @synthesize title, key, teaser, tags, items, progressBar; JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
According to the comments, it appears that you do wrong in your Magazine initializer. Using retain mode for the property doesn't really matter, but I would have used copy instead for string. Anyway, the title string coming from originalMag isn't retained, or copied at all when assigned to the title ivar of your Magazine, thus I bet it is deallocated before you try to print any value, causing the crash. Another point, doing : title = [[NSString alloc] init]; title = [originalMag title]; generates a memory leak (and you still don't retain the original title). Rewrite the initializer like so : -(id)initWithMagazine:(Magazine *)originalMag { ..... title = [[originalMag title] copy]; // or title = [[NSString alloc] initWithString:[originalMag title]]; .... } and this should solve your app crash.

Related questions

0 votes
    Helllo I am still new to programing and had a question about using if statements while using user input ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I write the following code to access the page but this is not working for me if (User.Identity. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I write the following code to access the page but this is not working for me if (User.Identity. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    Is it possible to get model's table name? I see that it's possible to get it from ModelStruct ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    what i want : i have a config file where it contains some urls in .json file stored in asset ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    I have a WPF application in which I use entity framework with mysql connector/net to obtain data back. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I have a WPF application in which I use entity framework with mysql connector/net to obtain data back. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    In adaline model what is the relation between output & activation value(x)? (a) linear (b) nonlinear (c) can be ... (d) none of the mentioned Please answer the above question....
asked Sep 21, 2022 in Education by JackTerrance
0 votes
    I'm trying to use Value.NativeQuery with ODBC coomection to Big Query And get Error Original Code: let ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    A consistency model used in distributed computing to achievehigh availability that informally guarantees that, if no ... )A Strong Consistency model (2)Eventually Consistent model...
asked Apr 21, 2021 in Technology by JackTerrance
0 votes
    having this code block of an example rails model class: class Block < ActiveRecord::Base has_many :bricks, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    How to get a particular item in the Model in Django?...
asked Jul 2, 2021 in Technology by JackTerrance
0 votes
    So the problem is i don't get get a value from textbox field on GridView RowUpdating event. Here ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I'm using TensorFlow Alpha 2.0. I have TFRecords files I'm reading from, each one holding a short ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    this is my first question here, i hope you can help me. I've been trying to get a specific path ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
...