Note that there are some explanatory texts on larger screens.

plurals
  1. POI cannot save retrieve NSurl from another class?
    primarykey
    data
    text
    <p>I have a function that returns a NSUrl, and i want to use it in another class. But when i tried to retrieve it in my other class, it gives me null. This is my First Class</p> <pre><code>@interface UOEventDetailController : UIViewController { NSURL *imgData; } @property(nonatomic, retain)NSURL *imgData; -(NSURL *)imgData; @implementation UOEventDetailController @synthesize imgData; </code></pre> <p>The .m File</p> <pre><code>-(NSURL *)imgData{ UOEventPost *post = (UOEventPost *)self.event; NSURL *url = [NSURL URLWithString:post.postImageURL]; return url; } </code></pre> <p>I want to retrieve the URL in this class</p> <pre><code>@class UOEventDetailController; @interface UOEnlargeImageViewController : UIViewController { IBOutlet UIImageView *enlargedImage; } @property (nonatomic, retain) UOEventDetailController *controller; @property (nonatomic, retain) IBOutlet UIImageView *enlargedImage; </code></pre> <p>the .m file</p> <pre><code>@implementation UOEnlargeImageViewController @synthesize controller; @synthesize enlargedImage; - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Enlarged Image"; controller = [[UOEventDetailController alloc]init]; NSURL *url = [controller imgData]; NSLog(@"%@",url); } @end </code></pre> <p>I can retrieve objects other than post.postImageUrl. For Example instead of post.postImageUrl, i put in string like @"omg", @"god" it gets retrieved in my other class...</p> <h2>EDIT</h2> <pre><code>-(IBAction)enlargeImg{ UOEventPost *post = (UOEventPost *)self.event; UOEnlargeImageViewController *enlarge = [[UOEnlargeImageViewController alloc]initWithNibName:nil bundle:nil]; enlarge.temp = post.postImageURL; [self.navigationController pushViewController:enlarge animated:YES]; [suggestPopupView removeFromSuperview]; [enlarge release]; } </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.
    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