Note that there are some explanatory texts on larger screens.

plurals
  1. POLoad variable from class in iOS
    primarykey
    data
    text
    <p>I feel stupid, and I am sleepless all because I want to get my app to work the way I want it to.</p> <p>I am trying to load the author variable from one class into a new class, but the new class is returning (null).</p> <p>I'm afraid I'm on the go right now, so I couldn't look at other examples. I'm typing this on my phone, I'll try my best to type the code.</p> <pre><code>NSString *html = [NSString stringWithFormat:@"&lt;html&gt; ... &lt;body&gt;&lt;h1&gt;%@&lt;/h1&gt; &lt;hr /&gt;%@&lt;hr /&gt;%@&lt;hr /&gt; &lt;/body&gt;&lt;html&gt;", self.title, author, userText]; </code></pre> <p>So I made the variable of author in the .h file:</p> <p><code>@property (strong, nonatomic) NSString *author;</code></p> <p>And then I made it load the author string from the master class:</p> <pre><code>BDNMasterViewController *mvc; author = mvc.author; </code></pre> <p>And then I made it log the Author in the master class:</p> <pre><code>NSString *authortext = @"Author: "; authortext = [authortext stringByAppendingString:author]; NSLog(authortext); </code></pre> <p>It logs the author correctly. It doesn't show the author here:</p> <p><img src="https://i.stack.imgur.com/jyd2F.png" alt="enter image description here"></p> <p>the (null) in the picture is what I'm trying to fix.</p> <p>What mistakes did I make? (Since I'm sleep deprived and everything)</p> <p>EDIT: I did import the Master in the Detail</p> <pre><code>#import "BDNMasterViewController.h" </code></pre> <p>To look at the entire MasterViewController and DetailViewController:</p> <p><a href="http://pastebin.com/ykJQs2B2" rel="nofollow noreferrer">http://pastebin.com/ykJQs2B2</a> - BDNMasterViewController.h</p> <p><a href="http://pastebin.com/xFbQc8UJ" rel="nofollow noreferrer">http://pastebin.com/xFbQc8UJ</a> - BDNMasterViewController.m</p> <p><a href="http://pastebin.com/SszmiAAh" rel="nofollow noreferrer">http://pastebin.com/SszmiAAh</a> - BDNDetailViewController.h</p> <p><a href="http://pastebin.com/SRKiQ21G" rel="nofollow noreferrer">http://pastebin.com/SRKiQ21G</a> - BDNDetailViewController.m</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.
 

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