I am facing the problem in displaying the value of string of AddNotesViewController
Class , in the Label of the DetailsOfPeopleViewController
.
All i want to do is whatever we entered in the UITextView
of 1 class,should display in the UILabel
of another class.
In file AddNotesViewController.h
UITextView *txtView;
@property(nonatomic,retain)IBOutlet UITextView *txtView;
in file AddNotesViewController.m
@synthesize txtView;
After this when i click on the tab bar item "save" then it should save in the data base , its saving to database and displaying the value also but its not passing the value to
DetailsOfPeopleViewController
.
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
NSLog(@"Tabbar selected itm %d",item.tag);
switch (item.tag) {
case 0:
appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
NotesTable *crashNotInvolvingObj11 = (NotesTable *)[NSEntityDescription
insertNewObjectForEntityForName:@"NotesTable" inManagedObjectContext:[appDelegate managedObjectContext]];
// CameraViewController *camera=[[CameraViewController alloc] init];
crashNotInvolvingObj11.personNote=[NSString stringWithFormat:@"%@",txtView.text];
DetailsOfPeopleViewController *detail=[DetailsOfPeopleViewController alloc];
detail.testPersonNotesStr =[NSString stringWithFormat:@"%@",txtView.text];
//(value of testPersonNotesStr is DISPLYING here... )
[appDelegate saveContext];
[detail release];
break;
..................
}
in DetailsOfPeopleViewController.h
NSString *testPersonNotesStr;
UILabel *PersonNotesLbl;
@property(nonatomic,retain)IBOutlet UILabel *PersonNotesLbl;
@property(nonatomic,retain) NSString *testPersonNotesStr;
in DetailsOfPeopleViewController.m
@synthesize PersonNotesLbl;
@synthesize testPersonNotesStr;
- (void)viewDidLoad
{
[super viewDidLoad];
[PersonNotesLbl setText:testPersonNotesStr];
NSLog(@"PERSON NOTE is........ %@",testPersonNotesStr);
//(value of testPersonNotesStr is NOT DISPLYING here..... )
}
Please guide me where am I doing the mistake.