Last active
August 29, 2015 14:27
-
-
Save jungchris/150896f54c43a46b30a5 to your computer and use it in GitHub Desktop.
ViewDidLoad Sets View Using indexOfIdInOrganizationsArray
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// NSLog(@"Sponsor #: %li", (long)self.selectedRow); | |
// set view | |
NSInteger orgIndex = [SharedConferenceObject indexOfIdInOrganzationsArray:[NSNumber numberWithInteger:self.selectedRow]]; | |
if ((NSNotFound == orgIndex) || (orgIndex >= [SharedConferenceObject.organizationsArray count])) { | |
// there's a problem ... | |
NSLog(@"CATCH: SponsorDetailVC array index notFound/bounds for selectedRow: %lu", (long)self.selectedRow); | |
} else { | |
// Everything's Ok, display everything wanted | |
int sponsorLevel = [SharedConferenceObject.organizationsArray[orgIndex] organizationSponsorLevel]; | |
if (sponsorLevel == 1) { | |
self.imageLogo.image = [UIImage imageNamed:@"badge-bronze.png"]; | |
} else if (sponsorLevel == 2) { | |
self.imageLogo.image = [UIImage imageNamed:@"badge-silver.png"]; | |
} else if (sponsorLevel == 3) { | |
self.imageLogo.image = [UIImage imageNamed:@"badge-gold.png"]; | |
} | |
// display appropriate details | |
self.labelOrgName.text = [SharedConferenceObject.organizationsArray[orgIndex] organizationName]; | |
self.labelType.text = [SharedConferenceObject.organizationsArray[orgIndex] organizationType]; | |
self.labelDescription.text = [SharedConferenceObject.organizationsArray[orgIndex] organizationDescription]; | |
// other details <snipped> ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This sets the the user interface view details using the SharedConferenceObject class index. See indexOfIdInOrganizationsArray for further info on this in ConferenceModel.m