Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8790381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:38:08+00:00 2026-06-13T22:38:08+00:00

I am using Xcode 4.5 and targeting iOS 5 and above. I have a

  • 0

I am using Xcode 4.5 and targeting iOS 5 and above.
I have a popover that allows a user to change the background of the underlying view.

When tapping on the “button”, it requires that I tap twice to see the change.
I am using NSNotification. I have tried Delegation, yet it does nothing.
Any help or tips would be greatly appreciated.

From viewWillAppear:

    // nav button is for background image selection
    navigationBtn.tag = buttonTag;
    [navigationBtn setBackgroundImage:[UIImage imageNamed:tempImage] forState:UIControlStateNormal];

    if (selectFlag) {
       [navigationBtn addTarget:self action:@selector(BGSelected:) forControlEvents:UIControlEventTouchUpInside];
    } else {
       navigationBtn.adjustsImageWhenHighlighted = NO;
    }

And the method for selection:

- (void)BGSelected:(id)sender { 
    self.bgtag = [sender tag];
    SettingsDAO *settingsDao = [[SettingsDAO alloc] init];

    if ([self.currentView isEqualToString:@"New_Journal"])
    {
       NSLog(@"Update Journals Background");
       [settingsDao updateJournalBackgroundId:self.journalId withBackgroundId:self.bgtag];
    }
    // notification to let EntryView know the background has changed
    [[NSNotificationCenter defaultCenter] postNotificationName:@"aBackgroundChanged"
                                                    object:self];

    [settingsDao release];
}

the NSNotification Method:

- (void)aBackgroundChanged:(NSNotification *)notification {
    [self invalidate];
    [self reloadSettings];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:38:09+00:00Added an answer on June 13, 2026 at 10:38 pm

    If you are using storyboard, and your popover is a segue you can do like that:

    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
       // perform all the operations...ecc
       [[(UIStoryboardPopoverSegue*)segue popoverController] setDelegate:self];
    }
    

    Then you have to make sure your caller controller has all the delegate methods.

    Or, with NSNotification:

    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
       // perform all the operations...ecc
       [[NSNotificationCenter defaultCenter]
           addObserver:self
           selector:@selector(changeBackground:)
           name:BackgroundHasChangedNotification
           object:[segue destinationViewController]];
    }
    

    Then just remember to remove observer in dealloc, and in change background method:

    -(void)changeBackground:(NSNotification*)notification {
    
       NSDictionary *userInfo = notification.userInfo;
       // I assume you are using background name
       NSString *backgroundName = [userInfo objectForKey:BackgroundOneConstant];
       // do the rest....
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

FWIW I'm using Xcode 4.5.1. I have a View that will contain UI elements
Using Xcode I have View A that navigates to View B. Upon pressing the
Using XCode 4.4 and Mountain Lion, I have a UIImageView, and on that view,
Currently using Xcode 4.2 and I have two view controllers (1 and 2). I
I'm using Xcode 4.3 and I have followed this user's steps to create the
Using XCode 3.2, What I'm trying to do is have the user input data
using xcode 4.2 and iOS 5 and have nav bar on root controller and
Using Xcode 4.2.1 iPad iOS 5.0.1, create a new Single View iPad project. In
I am using Xcode 4.5. I developing an iOS app, I am targeting iOS
I am using xcode 4, Compiler version LLVM GCC 4.2. I have been trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.