Hi, I am working on transferring data via NSUserDefaults and I have to 2 views which I am using a certain transition on and I don't think it really matters. I am not allows to mention what the transition is according to Apple but you developers will probably know which new transition I am talking about. So I want to transfer an image to pop up on the first view. So I have 2 views. When you first open the app thats your mainview and on the bottom right there is a info button that takes you to a settings view. I have a UISegmentBar on that view and I want it where if you select one of the segments then go back to the mainview it changes the mainviews image to the image you selected on the settings view. So this is the code I put in the Settings view:
Quote:
if(segment.selectedSegmentIndex == 0)
{
NSUserDefaults *sport = [NSUserDefaults standardUserDefaults];
[sport setObject:[UIImage imageNamed:@"Basketball.png"] forKey:@"basketballKey"];
[sport synchronize];
}
|
and this is what I put in the mainview which is suppose to retrieve the data in the viewdidload.
Quote:
|
mainImage.image = [[NSUserDefaults standardUserDefaults] objectForKey:@"basketballKey"];
|
Also the transition I am using doesn't have a back button because thats the new transition. So yea. What can I do? Please help asap if you can.