Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9016647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:03:08+00:00 2026-06-16T04:03:08+00:00

A really noob question here. I have 2 VCs. One is called SGPlayer and

  • 0

A really noob question here.
I have 2 VCs.
One is called SGPlayer and another is SGDownloader. Basically I want to change the property of SGDownloader from the first class.
I import the SGDownloader class like this:

//  SGPlayer.h

#import <UIKit/UIKit.h>
#import "SGDownloader.h"

@interface SGPlayer : UIViewController

@property (nonatomic, retain) SGDownloader *downloaderClass;

SGPlayer.m is like this:

//  SGPlayer.m

#import "SGPlayer.h"

@interface SGPlayer ()

@end

@implementation SGPlayer
@synthesize downloaderClass;

I then set the downloadUrl property form the SGDownloader class in an action triggered by UIButton like that:

- (IBAction)loadURLButton:(id)sender {

    [self performSegueWithIdentifier:@"loadMyData" sender:nil];
    downloaderClass.downloadURL = [NSURL URLWithString:@"http://www.google.com"];
}

NSLog gives me (null) on my URL. If I use prepareForSegue method all is fine:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    if ([[segue identifier] isEqualToString:@"loadMyData"])
    {
        SGDownloader *vc = [segue destinationViewController];

        vc.downloadURL = [NSURL URLWithString:@"http://www.google.com"];
    }
}

The thing is I don’t want to use prepareForSegue here.

I assume I might be misunderstanding the whole concept of how do you transfer the data between classes in Obj-C.

Edit:

I do have a synthesised property in the SGDownloader class:

@interface SGDownloader : UIViewController

@property (nonatomic, retain) NSURL *downloadURL;

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:03:09+00:00Added an answer on June 16, 2026 at 4:03 am

    Either create property of downloadURL and synthesize it or you can use delegate to pass values between class

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is really a noob quick question. Imagine you have a struct called No
sorry, this is a really noob question... When I want to print part of
a noob question here. I have the following code: - (IBAction)selectExistingPicture { if ([UIImagePickerController
Sorry for a really noob-level question... I want to apply a specific piece of
I didn't really use maven so it may be noob question. I have Eclipse
I am really new to XML and JDOM so I have a noob question,
Ok. very much totally noob question but I really don't have a clue and
Really ripping my hair out on this one. I have a JAAS Authentication Provider
Really quick jQuery question... I have this function: $(document).ready(function() { $('a#show1').click(function() { $('.item1').toggle(1000); return
This is probably a noob question that I will get slated for but here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.