From 8d51fd249b6fdffcad890abece899edddc7d83e7 Mon Sep 17 00:00:00 2001 From: Miles Crabbe Date: Fri, 6 Jun 2014 16:46:16 -0500 Subject: [PATCH] -small bug fix -user info showed null instead of just empty when they were empty in the defaults --- .../UniversityPrograms/MyUPInitTableViewCell.m | 5 ++++- .../UniversityPrograms/MyUPInitTableViewCell.xib | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/UniversityPrograms/UniversityPrograms/MyUPInitTableViewCell.m b/UniversityPrograms/UniversityPrograms/MyUPInitTableViewCell.m index 9cdb893..9fe779f 100644 --- a/UniversityPrograms/UniversityPrograms/MyUPInitTableViewCell.m +++ b/UniversityPrograms/UniversityPrograms/MyUPInitTableViewCell.m @@ -16,11 +16,14 @@ -(instancetype)init{ return self; } -(void)build{ + if([[[NSUserDefaults standardUserDefaults] stringForKey:@"cwid"] isEqualToString:@""]||[[NSUserDefaults standardUserDefaults] stringForKey:@"cwid"] ==nil){} + else{ self.firstNameLabel.text=[NSString stringWithFormat:@"First Name: %@",[[NSUserDefaults standardUserDefaults] stringForKey:@"userFirstName"]]; self.lastNameLabel.text=[NSString stringWithFormat:@"Last Name: %@",[[NSUserDefaults standardUserDefaults] stringForKey:@"userLastName"]]; self.cwidLabel.text=[NSString stringWithFormat:@"CWID: %@",[[NSUserDefaults standardUserDefaults] stringForKey:@"cwid"]]; - self.emailLabel.text=[NSString stringWithFormat:@"EMAIL: %@",[[NSUserDefaults standardUserDefaults] stringForKey:@"email"]]; + self.emailLabel.text=[NSString stringWithFormat:@"Email: %@",[[NSUserDefaults standardUserDefaults] stringForKey:@"email"]]; + } self.myUPImage.image=[UIImage imageNamed:@"UP.jpg"]; self.emailLabel.backgroundColor=[UIColor whiteColor]; self.lastNameLabel.backgroundColor=[UIColor whiteColor]; diff --git a/UniversityPrograms/UniversityPrograms/MyUPInitTableViewCell.xib b/UniversityPrograms/UniversityPrograms/MyUPInitTableViewCell.xib index 190ef4f..1face81 100644 --- a/UniversityPrograms/UniversityPrograms/MyUPInitTableViewCell.xib +++ b/UniversityPrograms/UniversityPrograms/MyUPInitTableViewCell.xib @@ -18,24 +18,24 @@ -