UNdo ReDo blowing up.

Discussion in 'iOS Programming' started by IDMah, Dec 18, 2011.

  1. IDMah, Dec 18, 2011
    Last edited: Dec 18, 2011

    IDMah macrumors 6502

    IDMah

    Joined:
    May 13, 2011
    #1
    I had the undo redo working fine.. or so I though.

    I killed a bug that was undoing something not done yet .. stupid mistake on my part.

    but now I keep crashing .. with this..

    Code:
    -[NSSubstringPredicateOperator set]: unrecognized selector sent to instance 0x4e385f0
    2011-12-18 18:38:00.931 FooChallenge[4244:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSSubstringPredicateOperator set]: unrecognized selector sent to instance 0x4e385f0'
    *** Call stack at first throw:
    (
    	0   CoreFoundation                      0x00dc1be9 __exceptionPreprocess + 185
    	1   libobjc.A.dylib                     0x00f165c2 objc_exception_throw + 47
    	2   CoreFoundation                      0x00dc36fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    	3   CoreFoundation                      0x00d33366 ___forwarding___ + 966
    	4   CoreFoundation                      0x00d32f22 _CF_forwarding_prep_0 + 50
    	5   UIKit                               0x003eb6fa -[UILabel _drawTextInRect:baselineCalculationOnly:] + 2219
    	6   UIKit                               0x003e8b40 -[UILabel drawTextInRect:] + 70
    	7   UIKit                               0x003026eb -[UIView(CALayerDelegate) drawLayer:inContext:] + 426
    	8   QuartzCore                          0x01c879e9 -[CALayer drawInContext:] + 143
    	9   QuartzCore                          0x01c85f03 -[CALayer _display] + 524
    	10  QuartzCore                          0x01c85be4 CALayerDisplayIfNeeded + 231
    	11  QuartzCore                          0x01c7838b _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 325
    	12  QuartzCore                          0x01c780d0 _ZN2CA11Transaction6commitEv + 292
    	13  QuartzCore                          0x01ca87d5 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99
    	14  CoreFoundation                      0x00da2fbb __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
    	15  CoreFoundation                      0x00d380e7 __CFRunLoopDoObservers + 295
    	16  CoreFoundation                      0x00d00bd7 __CFRunLoopRun + 1575
    	17  CoreFoundation                      0x00d00240 CFRunLoopRunSpecific + 208
    	18  CoreFoundation                      0x00d00161 CFRunLoopRunInMode + 97
    	19  GraphicsServices                    0x016f6268 GSEventRunModal + 217
    	20  GraphicsServices                    0x016f632d GSEventRun + 115
    	21  UIKit                               0x002d942e UIApplicationMain + 1160
    	22  FooChallenge                   0x00002644 main + 102
    	23  FooChallenge                   0x000025d5 start + 53
    
    Any hints on what is causing this, would be greatly appreciated.
    thanks
    Ian
     
  2. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    More helpful than your crash logs might be your source code related to the crash.
     
  3. IDMah, Dec 19, 2011
    Last edited: Dec 20, 2011

    IDMah thread starter macrumors 6502

    IDMah

    Joined:
    May 13, 2011
    #3
    totally unrelated but at fault.

    Turns out that I was using..

    Code:
    UIColor *fooColourSet;
    fooColourSet = [UIColor colorWithRed:.6 green:0 blue:0 alpha:1];
    
    when I sub:
    Code:
    fooColourSet = [UIColor redColor];
    
    it works fine.. not a problem with undo after all I guess I should look
    I thought I could just slap that in for redColor.. guess I was wrong..
    Any Ideas??


    thanks
    Ian


    ps. Yeap forgot to retain the colour. like this..

    Code:
    [[UIColor alloc] initWithRed:0.5f green:0.5f blue:0.5f alpha:1.0f];
    
     

Share This Page