Not able to set the values to property from another class

Discussion in 'iOS Programming' started by asifpv, Apr 14, 2009.

  1. asifpv macrumors newbie

    Apr 13, 2009
    Hi Friends,

    i am not able to set the property values from another class.

    Please see my code,
    ----- FNController.m -------
    Am calling below method from FNView.xib, after submitting save button

    -(void) save_Clickedid)sender {

    NSString* fname = self.tFirstName.text;
    NSString* lname = self.tLastName.text;

    AddViewController *avcObj = [[AddViewController alloc] init];

    [avcObj setTxtNameLabel:fname :lname];

    [self.navigationController dismissModalViewControllerAnimated:YES];
    // Navigating to AddView.xib

    here is am setting the properties
    ---- AddViewController.m----

    - (void) setTxtNameLabelNSString *)fn: (NSString *)ln{

    self.txtFirstName.text = fn;

    self.txtLastName.text = ln;

    NSString* name = [[fn stringByAppendingString:mad:" "] stringByAppendingString:ln];

    int intVal = name.length;

    if(intVal == 0)
    self.txtName.text = @"No name";
    self.txtName.text = name;


    after doing this my UILabel (ie.txtName) not getting updated..but when i debug the program am able to get the value in "name" hence it going to else part of the if statement.

    Anyone knowing please help me to do this...


Share This Page