Giter Site home page Giter Site logo

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7fb0d15ce510 of class WYPopoverTheme was deallocated while key ... about wypopovercontroller HOT 5 OPEN

JulesMoorhouse avatar JulesMoorhouse commented on September 18, 2024
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7fb0d15ce510 of class WYPopoverTheme was deallocated while key ...

from wypopovercontroller.

Comments (5)

vitalys avatar vitalys commented on September 18, 2024

Could you share some code? How do you use WYPopoverController?

from wypopovercontroller.

JulesMoorhouse avatar JulesMoorhouse commented on September 18, 2024

Let me know if you need any more


- (IBAction)btnPopoverTapped:(id)sender
{
    //-- popover common --
    if (popoverController == nil)
    {
        UIView* btn = (UIView*)sender;

        PopoverHandlerController* pop = [[PopoverHandlerController alloc] init];

        pop.preferredContentSize = CGSizeMake(popoverContentMainWidth, popoverContentMainheight_Portrait);

        pop.title = @"Actions";
        pop.popDelegate = self;
        pop.intPopoverStyle = [self selfPopoverStyle];
        pop.strContentType = [self selfContentType];

        [pop.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithTitle:@"Apply" style:UIBarButtonItemStyleDone target:self action:@selector(btnPopoverDone:)]];

        [pop.navigationItem.leftBarButtonItem setTitleTextAttributes:@{
                                                                        NSFontAttributeName: [UIFont fontWithName:gstrDefaultFontName size:gintNavigationBarFontSize]
                                                                        } forState:UIControlStateNormal];

        UINavigationController* contentViewController = [[UINavigationController alloc] initWithRootViewController:pop];
        [PopoverInstance setup];

        popoverController = [[WYPopoverController alloc] initWithContentViewController:contentViewController];

        popoverController.delegate = self;
        popoverController.passthroughViews = @[btn];
        popoverController.popoverLayoutMargins = UIEdgeInsetsMake(10, 10, 10, 10);
        popoverController.wantsDefaultContentAppearance = NO;

        [popoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:WYPopoverArrowDirectionAny animated:YES options:WYPopoverAnimationOptionFadeWithScale];
    }
    else
    {
        [self btnPopoverDone:nil];
    }
    return;
    //-- popover common --
    NSString *msg;
    if (intSelViewRow == 0)
    {
        msg = @"Select 'Current' Sorting";
    }
    else
    {
        msg = @"Select 'Ended' Sorting";
    }

}
---
#import <UIKit/UIKit.h>
//#import "WYPopoverController.h"
#import "Constants.h"
#import <WYPopoverController/WYPopoverController.h>

#define popoverItemAccountSelect 1000
#define popoverItemSortCurrent 1010
#define popoverItemSortEnded 1020
#define popoverItemDateFilterFuture 1030
#define popoverItemDateFilterPast 1040
#define popoverItemDateFilterBoth 1050
#define popoverItemCSVExport 1060

@protocol PopoverHandlerControllerDelegate;

@interface PopoverHandlerController : UITableViewController;

@property (nonatomic, weak) id<PopoverHandlerControllerDelegate> popDelegate; // if you use ARC
@property (nonatomic, assign) ePopoverStyle intPopoverStyle;
@property (nonatomic, strong) NSString* strContentType;

@property (nonatomic, strong) NSMutableArray *arrRows;

@end

@protocol PopoverHandlerControllerDelegate <NSObject>;
@optional
- (void)popoverHandler:(PopoverHandlerController*)controller didSelectItem:(NSUInteger)row;
@end

------

#import "PopoverHandlerController.h"
#import "AccountSelTableViewController.h"
#import "SortingTableViewController.h"
#import "DateFilterTableViewController.h"
#import "General.h"
#import "Styles.h"
#import "Prefs.h"
#import "PopoverInstance.h"
#import "ManageDateRange.h"
#import <QuartzCore/QuartzCore.h>

@interface PopoverHandlerController ()

@end

@implementation PopoverHandlerController
@synthesize popDelegate;
@synthesize intPopoverStyle;
@synthesize arrRows;
@synthesize strContentType;

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

    self.tableView.alwaysBounceVertical = NO;

    self.tableView.backgroundColor = [General colorFromHexString:iOS7_gray_light];//[UIColor lightGrayColor]; //PopBG

    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:gstrDefaultFontName size:gintNavigationBarFontSize]}];

    // --- accessibility ---
    self.tableView.accessibilityTraits = UIAccessibilityTraitStaticText;
    self.tableView.accessibilityLabel = @"Actions Selection";
    self.tableView.accessibilityElementsHidden = NO;
    self.tableView.isAccessibilityElement = YES;
    // --- accessibility ---

    self.accessibilityTraits = UIAccessibilityTraitStaticText;
    self.accessibilityLabel = @"Actions";
    self.accessibilityElementsHidden = NO;
    self.isAccessibilityElement = YES;

    self.arrRows = [[NSMutableArray alloc] init];

    [self.arrRows addObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger: popoverItemAccountSelect], @"item", nil]];

    switch (self.intPopoverStyle) {
        case ePopoverStyle_ACSel_Sort_Current_Portrait:
            [self.arrRows addObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger: popoverItemSortCurrent], @"item", nil]];
            break;
---snip ---
    }

    [PopoverInstance setTemporaryOptions:self.intPopoverStyle content_type:self.strContentType];

}

-(void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:YES];


    [self.tableView reloadData];

    switch (self.intPopoverStyle) {
        case ePopoverStyle_ACSel_Portrait:
        case ePopoverStyle_ACSel_Sort_Current_Portrait:
        case ePopoverStyle_ACSel_Sort_Ended_Portrait:
        case ePopoverStyle_ACSel_DateSel_Future_Portrait:
        case ePopoverStyle_ACSel_DateSel_Past_Portrait:
        case ePopoverStyle_ACSel_DateSel_Both_Portrait:
        case ePopoverStyle_ACSel_DateSel_Both_CSV_Portrait:
            self.preferredContentSize = CGSizeMake(popoverContentMainWidth, popoverContentMainheight_Portrait);
            DLog(@"PoperHandlerController viewDidAppear PORT w=%d h=%d", popoverContentMainWidth, popoverContentMainheight_Portrait);
            break;
        case ePopoverStyle_ACSel_DateSel_Future_Landscape:
        case ePopoverStyle_ACSel_DateSel_Past_Landscape:
        case ePopoverStyle_ACSel_DateSel_Both_Landscape:
        case ePopoverStyle_ACSel_DateSel_Both_CSV_Landscape:
            self.preferredContentSize = CGSizeMake(popoverContentMainheight_Landscape, popoverContentMainWidth);
            DLog(@"PoperHandlerController viewDidAppear LAND w=%d h=%d", popoverContentMainheight_Landscape, popoverContentMainWidth);
            break;
        default:
            break;
    }

}

-(void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:YES];

    self.preferredContentSize = CGSizeZero;

}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [arrRows count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier];
    }

    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;

    NSInteger rowitem = [[[self.arrRows objectAtIndex:indexPath.row] objectForKey:@"item"] integerValue];

    NSUserDefaults *myDefaults = [NSUserDefaults standardUserDefaults];

    Styles *ap = [[Styles alloc] init];
    eScreenChoice screen = ScreenChoice_Calculate_Balance;

    switch (rowitem) {
        case popoverItemAccountSelect:
        {
            cell.textLabel.text = @"Account Select";

            cell.textLabel.font = [UIFont fontWithName:gstrDefaultFontName size:gintDefaultFontSize];

            cell.detailTextLabel.font = [UIFont fontWithName:gstrDefaultFontName size:gintDefaultFontSize];

            [ap setLabelColour:cell.textLabel screen:screen controlChoice:con_lblAccountNameCB style:addi_None];

            General *gen = [General alloc];
            NSInteger intAppSelectedACID = [Prefs returnSettingInt:kNSU_pfAppSelectedAccountID_candidate defaultValue:1];
            cell.detailTextLabel.text = [gen getAccountName:intAppSelectedACID];
            //cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ ", cell.detailTextLabel.text];
            cell.detailTextLabel.adjustsFontSizeToFitWidth = YES;
            [cell.detailTextLabel sizeToFit];

            break;
        }
--snip---
        default:
            break;
    }

    // --- accessibility ---
    cell.textLabel.accessibilityTraits = UIAccessibilityTraitSelected;
    //cell.textLabel.accessibilityTraits = UIAccessibilityTraitUpdatesFrequently;
    cell.textLabel.accessibilityLabel = cell.textLabel.text;
    cell.textLabel.accessibilityElementsHidden = NO;
    cell.textLabel.isAccessibilityElement = YES;
    // --- accessibility ---

    // --- accessibility ---
    cell.detailTextLabel.accessibilityTraits = UIAccessibilityTraitSelected;
    //cell.detailTextLabel.accessibilityTraits = UIAccessibilityTraitUpdatesFrequently;
    cell.detailTextLabel.accessibilityLabel = cell.detailTextLabel.text;
    cell.detailTextLabel.accessibilityElementsHidden = NO;
    cell.detailTextLabel.isAccessibilityElement = YES;
    // --- accessibility ---


    // --- accessibility ---
    //cell.accessibilityTraits = UIAccessibilityTraitSelected;
    cell.accessibilityTraits = UIAccessibilityTraitUpdatesFrequently;
    cell.accessibilityLabel = cell.textLabel.text;
    cell.accessibilityElementsHidden = NO;
    cell.isAccessibilityElement = YES;
    // --- accessibility ---

    return cell;
}

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    cell.backgroundColor = [General colorFromHexString:iOS7_gray_light];//[UIColor lightGrayColor]; //PopBG
}

#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    if (self.popDelegate != nil && [self.popDelegate respondsToSelector:@selector(popoverHandler:didSelectItem:)] == YES) {

        NSInteger rowitem = [[[self.arrRows objectAtIndex:indexPath.row] objectForKey:@"item"] integerValue];

        //LEAVE THIS COMMENTED YOU WILL NEED IT IF YOU ADD A TAPABLE FEATURE HERE, AKA WITHOUT HAVING TO USE THE DONE BUTTON @!@
        //[self.popDelegate popoverHandler:self didSelectItem:rowitem];

        switch (rowitem) {
            case popoverItemAccountSelect: {

                NSInteger intAppSelectedACID = [Prefs returnSettingInt:kNSU_pfAppSelectedAccountID_candidate defaultValue:1];

                AccountSelTableViewController *nextController = [[AccountSelTableViewController alloc] initWithNibName:@"AccountSelTableView" bundle:nil];
                nextController.title = @"Accounts";
                nextController.intAppSelectedACID = intAppSelectedACID;

                switch (self.intPopoverStyle) {
                    case ePopoverStyle_ACSel_Portrait:
                    case ePopoverStyle_ACSel_Sort_Current_Portrait:
                    case ePopoverStyle_ACSel_Sort_Ended_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Future_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Past_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Both_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Both_CSV_Portrait:
                        nextController.preferredContentSize = CGSizeMake(popoverContentMainWidth, popoverContentMainheight_Portrait);
                        DLog(@"PoperHandlerController didSelectRow ActSel PORT w=%d h=%d", popoverContentMainWidth, popoverContentMainheight_Portrait);
                        break;
                    case ePopoverStyle_ACSel_DateSel_Future_Landscape:
                    case ePopoverStyle_ACSel_DateSel_Past_Landscape:
                    case ePopoverStyle_ACSel_DateSel_Both_Landscape:
                    case ePopoverStyle_ACSel_DateSel_Both_CSV_Landscape:
                        nextController.preferredContentSize = CGSizeMake(popoverContentMainheight_Landscape, popoverContentMainWidth);
                        DLog(@"PoperHandlerController didSelectRow ActSel LAND w=%d h=%d", popoverContentMainheight_Landscape, popoverContentMainWidth);
                        break;
                    default:
                        break;
                }

                self.navigationController.navigationBar.translucent = NO; //TEST THIS
                [General transitionOpen:self option:eTransitionOption_Ease_Vertical_All];
                [self.navigationController pushViewController:nextController animated:NO]; //POPANIM

                break;
            }
            case popoverItemSortEnded:
            case popoverItemSortCurrent: {

                SortingTableViewController *sortTVC = [[SortingTableViewController alloc] initWithNibName:@"SortingTableViewController" bundle:nil];

                //SortingTableViewController *sortTVC = [[SortingTableViewController alloc] initWithStyle:UITableViewStyleGrouped];

                switch (self.intPopoverStyle) {
                    case ePopoverStyle_ACSel_Portrait:
                    case ePopoverStyle_ACSel_Sort_Current_Portrait:
                    case ePopoverStyle_ACSel_Sort_Ended_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Future_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Past_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Both_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Both_CSV_Portrait:
                        sortTVC.preferredContentSize = CGSizeMake(popoverContentMainWidth, popoverContentSortHeight_Portrait);
                        DLog(@"PoperHandlerController didSelectRow SortTbl PORT w=%d h=%d", popoverContentMainWidth, popoverContentSortHeight_Portrait);
                        break;
                    case ePopoverStyle_ACSel_DateSel_Future_Landscape:
                    case ePopoverStyle_ACSel_DateSel_Past_Landscape:
                    case ePopoverStyle_ACSel_DateSel_Both_Landscape:
                    case ePopoverStyle_ACSel_DateSel_Both_CSV_Landscape:
                        sortTVC.preferredContentSize = CGSizeMake(popoverContentSortHeight_Landscape, popoverContentMainWidth);
                        DLog(@"PoperHandlerController didSelectRow SortTbl LAND w=%d h=%d", popoverContentSortHeight_Landscape, popoverContentMainWidth);
                        break;
                    default:
                        break;
                }

                sortTVC.intPopoverStyle = self.intPopoverStyle;

                self.navigationController.navigationBar.translucent = NO; //TEST THIS
                [General transitionOpen:self option:eTransitionOption_Ease_Vertical_All];
                [self.navigationController pushViewController:sortTVC animated:NO]; //POPANIM

                break;
            }
            case popoverItemDateFilterFuture:
            case popoverItemDateFilterPast:
            case popoverItemDateFilterBoth: {

                DateFilterTableViewController *dfTV = [[DateFilterTableViewController alloc] initWithNibName:@"DateFilterTableViewController" bundle:nil];

                //DateFilterTableViewController *dfTV = [[DateFilterTableViewController alloc] initWithStyle:UITableViewStyleGrouped];

                dfTV.strContentType = self.strContentType;
                dfTV.intPopoverStyle = self.intPopoverStyle;

                switch (self.intPopoverStyle) {
                    case ePopoverStyle_ACSel_Portrait:
                    case ePopoverStyle_ACSel_Sort_Current_Portrait:
                    case ePopoverStyle_ACSel_Sort_Ended_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Future_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Past_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Both_Portrait:
                    case ePopoverStyle_ACSel_DateSel_Both_CSV_Portrait:
                        dfTV.preferredContentSize = CGSizeMake(popoverContentMainWidth, popoverContentDateFilerHeight_Portrait);
                        DLog(@"PoperHandlerController didSelectRow DateFil PORT w=%d h=%d", popoverContentMainWidth, popoverContentDateFilerHeight_Portrait);
                        break;
                    case ePopoverStyle_ACSel_DateSel_Future_Landscape:
                    case ePopoverStyle_ACSel_DateSel_Past_Landscape:
                    case ePopoverStyle_ACSel_DateSel_Both_Landscape:
                    case ePopoverStyle_ACSel_DateSel_Both_CSV_Landscape:
                        dfTV.preferredContentSize = CGSizeMake(popoverContentDateFilerHeight_Landscape, popoverContentMainWidth);
                        DLog(@"PoperHandlerController didSelectRow DateFil LAND w=%d h=%d", popoverContentDateFilerHeight_Landscape, popoverContentMainWidth);
                        break;
                    default:
                        break;
                }

                self.navigationController.navigationBar.translucent = NO; //TEST THIS
                [General transitionOpen:self option:eTransitionOption_Ease_Vertical_All];
                [self.navigationController pushViewController:dfTV animated:NO]; //POPANIM

                break;
            }
            case popoverItemCSVExport:
            {
                [self.popDelegate popoverHandler:self didSelectItem:rowitem];
                break;
            }
            default:
                break;
        }

    }

}


- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section {

    NSString *ret;
    ret= nil;
    return ret;

}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {

    CGFloat ret = nanf(NULL);

    switch (self.intPopoverStyle) {
        case ePopoverStyle_ACSel_DateSel_Both_CSV_Landscape:
        case ePopoverStyle_ACSel_DateSel_Both_CSV_Portrait:
            ret = 60.0f;
            break;
        default:
            break;
    }

    return ret;
}


- (UIView *)tableView:(UITableView *)tv viewForFooterInSection:(NSInteger)section
{
    UIView *ret = nil;

    switch (self.intPopoverStyle) {
        case ePopoverStyle_ACSel_DateSel_Both_CSV_Landscape:
        case ePopoverStyle_ACSel_DateSel_Both_CSV_Portrait:
        {
            CGRect footerRect = [self.tableView rectForFooterInSection:section];
            UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, footerRect.size.width, 20.0)];
            footer.autoresizesSubviews = YES;
            footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
            footer.userInteractionEnabled = YES;

            footer.hidden = NO;
            footer.multipleTouchEnabled = NO;
            footer.opaque = NO;
            footer.contentMode = UIViewContentModeScaleToFill;

            UILabel *footerLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, footerRect.size.width - 20, 20.0)];
            footerLabel.backgroundColor = [UIColor clearColor];

            footerLabel.text = @"Tap 'Apply' to set filters";

            footerLabel.font = [UIFont fontWithName:gstrDefaultFontName size:gintFooterNoteFontSize];

            Styles *ap = [[Styles alloc] init];
            eScreenChoice screen = ScreenChoice_Category_Maint;
            footerLabel.textColor = [UIColor whiteColor];
            footerLabel.textColor = [ap setColour:screen controlChoice:con_tableFooter style:addi_None];

            footerLabel.numberOfLines = 0;
            footerLabel.textAlignment = NSTextAlignmentCenter;

            [footer addSubview:footerLabel];
            //xxxds;
            return footer;
        }
        default:
            return ret;
            break;
    }

}

@end
-----

#import <Foundation/Foundation.h>
#import "Constants.h"

@interface PopoverInstance : NSObject

+(void)setup;
+(void)setTemporaryOptions:(ePopoverStyle)intPopoverStyle content_type:(NSString*)strContentType;
+(BOOL)haveOptionsChanged:(ePopoverStyle)intPopoverStyle content_type:(NSString*)strContentType;

@end
-----


#import "PopoverInstance.h"
//#import "WYPopoverController.h"
#import "General.h"
#import "Styles.h"
#import "ManageDateRange.h"
#import "BalanceGuideAppDelegate.h"
#import <WYPopoverController/WYPopoverController.h>

@implementation PopoverInstance

+(void)setup
{
    [WYPopoverController setDefaultTheme:[WYPopoverTheme theme]];

    [[WYPopoverBackgroundView appearance] setViewContentInsets:UIEdgeInsetsMake(0, 1, 0, 1)];
    [[WYPopoverBackgroundView appearance] setOuterCornerRadius:10];
    [[WYPopoverBackgroundView appearance] setMinOuterCornerRadius:10];

    [[WYPopoverBackgroundView appearance] setOuterShadowBlurRadius:6];
    [[WYPopoverBackgroundView appearance] setOuterShadowColor:[UIColor colorWithWhite:0 alpha:0.65]];
    [[WYPopoverBackgroundView appearance] setOuterShadowOffset:CGSizeMake(0, 2)];

}

+(void)setTemporaryOptions:(ePopoverStyle)intPopoverStyle content_type:(NSString*)strContentType {

    NSUserDefaults *myDefaults = [NSUserDefaults standardUserDefaults];
    NSString *sort_current = [myDefaults stringForKey: kNSU_SortingCurrent];
    NSString *sort_ended = [myDefaults   stringForKey: kNSU_SortingEnded];
    NSString *account = [myDefaults stringForKey: kNSU_pfAppSelectedAccountID];

    [myDefaults setObject:sort_current   forKey: kNSU_SortingCurrent_candidate];
    [myDefaults setObject:sort_ended     forKey: kNSU_SortingEnded_candidate];
    [myDefaults setObject:account   forKey: kNSU_pfAppSelectedAccountID_candidate];

    [myDefaults synchronize];


    ManageDateRange *candidate = [[ManageDateRange alloc] init];
    [candidate setStrPrivateContentType:@"TEMP"];
    [candidate setStrPrivateDateCustomType:intPopoverStyle];

    ManageDateRange *current = [[ManageDateRange alloc] init];
    [current setStrPrivateContentType:strContentType];
    [current setStrPrivateDateCustomType:intPopoverStyle];
    [current getGoodDates];

    NSDate* currentStartDate = [current getStartNSDate];
    NSDate* currentEndDate = [current getEndNSDate];

    [candidate setDatPrivateStartDate:currentStartDate];
    [candidate setDatPrivateEndDate:currentEndDate];
    [candidate checkDates];

    if ([candidate badDateSelected] == TRUE) {

        // hmmmm
    }

    [candidate saveDateRangeDate];

}

+(BOOL)haveOptionsChanged:(ePopoverStyle)intPopoverStyle content_type:(NSString*)strContentType {

    BOOL changed = NO;

    //CHECK CURRENT OR ENDED SORTING
    NSUserDefaults *myDefaults = [NSUserDefaults standardUserDefaults];
    NSString *current_sort = [myDefaults stringForKey:kNSU_SortingCurrent];
    NSString *ended = [myDefaults stringForKey:kNSU_SortingEnded];
    NSString *account = [myDefaults stringForKey:kNSU_pfAppSelectedAccountID];

    NSString *current_candidate = [myDefaults stringForKey:kNSU_SortingCurrent_candidate];
    NSString *ended_candidate = [myDefaults stringForKey:kNSU_SortingEnded_candidate];
    NSString *account_candidate = [myDefaults stringForKey:kNSU_pfAppSelectedAccountID_candidate];

    //WORK OUT IF ANYTHING HAS CHANGED, THEN UPDATE THE UI IF THERE IS A CHANGE
    //SO CANDIDATES WILL HAVE VALUES!!

    if (current_sort != current_candidate) {
        [myDefaults setObject:current_candidate forKey:kNSU_SortingCurrent];
        changed = YES;
    }

    if (ended != ended_candidate)
    {
        [myDefaults setObject:ended_candidate forKey:kNSU_SortingEnded];
        changed = YES;
    }

    if (account != account_candidate) {
        [myDefaults setObject:account_candidate forKey:kNSU_pfAppSelectedAccountID];
        changed = YES;
    }

    [myDefaults synchronize];

    if (![strContentType isEqualToString:@""]) {

        ManageDateRange *candidate = [[ManageDateRange alloc] init];
        [candidate setStrPrivateContentType:@"TEMP"];
        [candidate setStrPrivateDateCustomType:intPopoverStyle];

        [candidate getGoodDates];
        NSDate* candidateStartDate = [candidate getStartNSDate];
        NSDate* candidareEndDate = [candidate getEndNSDate];


        ManageDateRange *current = [[ManageDateRange alloc] init];
        [current setStrPrivateContentType:strContentType];
        [current setStrPrivateDateCustomType:intPopoverStyle];
        [current getGoodDates];
        NSDate* currentStartDate = [current getStartNSDate];
        NSDate* currentEndDate = [current getEndNSDate];

        if (![candidateStartDate isEqualToDate:currentStartDate] ||
            ![candidareEndDate isEqualToDate:currentEndDate])
        {
            [current setDatPrivateStartDate:candidateStartDate];
            [current setDatPrivateEndDate:candidareEndDate];
            [current checkDates];

            if ([current badDateSelected] == TRUE) {

                // hmmmm
            }

            [current saveDateRangeDate];
            changed = YES;

            BalanceGuideAppDelegate *appDel = (BalanceGuideAppDelegate*) [[UIApplication sharedApplication] delegate];
            appDel.gbooForecastRefreshNeeded = TRUE;
            appDel.gbooCategoriesHorizGrahRefreshNeeded = TRUE;
        }
        //Read these dates on the parent screen


    }


    return changed;
}

@end

from wypopovercontroller.

JulesMoorhouse avatar JulesMoorhouse commented on September 18, 2024

I will try going back to 0.3.8, I will let you know if that fixes it.
I'm pretty sure it will as the issue only started occurring after updating pods, now I think about it.

from wypopovercontroller.

JulesMoorhouse avatar JulesMoorhouse commented on September 18, 2024

Yep that fixed it, so there must be an issue with the new release ?

from wypopovercontroller.

vitalys avatar vitalys commented on September 18, 2024

Thank you for the confirmation. I'll take a look.

from wypopovercontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.