Rocky
Rocky

Reputation: 1423

How to update value with help of userid in iphone

I have a login page where I enter an username and password, then I get from server one userid which i store in my local database. It works but I have a problem in the second page updating the new value on the web server database. I want the value to change only when a user logs in. How can I pass a reference to a second page for a particular user and update the new value and make the change in the server database table. Your help is very vital to me.

Upvotes: 0

Views: 82

Answers (1)

iProgrammer
iProgrammer

Reputation: 3107

Whenever you get UserId save it in one Nsstring .. create one more Nsstring in second class and create property for it.

@interface FaceBookProfile : UITableViewController {


    NSString *userId;

}
//getter setter method

@property (nonatomic,retain) NSString *userId;

And pass the user id from first view to second view like this

FaceBookProfile *detailViewController = [[FaceBookProfile alloc] initWithNibName:@"FaceBookProfile" bundle:nil];

    //to animate activity indicator


detailViewController.userId = userId;
    [self.navigationController pushViewController:detailViewController animated:YES];
    [detailViewController release];

you can pass any value like above to any class

Upvotes: 1

Related Questions