Q:

iphone iOS4 breaking app

I have an application that has been running fine since its launch over a year ago.
I developed it with iphone iOS 2.2.1 originally and tested and kept selling it up until 3.2 without issues.
Now it fails to launch with iOS4.
the app uses a non standard size for a UIPickerView (I don't think that's the problem but just mention it as you will see some complaint in the console output). It's also giving previously non reported NSAutoreleasePool warnings.
But the culprit seems to be when resizing the interface to the new iphone screen resolution (at least what I get from the console)
I know I have to do some research of my own but iOS4 has been out for so little and I have been very absorbed learning and developing my first app for android (so I have not tested this particular code, after a year+ this app only sells a few copies a day) that I thought it didn't harm to ask around here to check if someone has some info or has run into it already.
First, this is the console output when build and run with XCODE 3.2.3 and BASE SDK 3.2, runs without problem

2010-06-22 23:25:55.619 metalsandmaterials[82956:207] ******* Accessibility Status Changed: On
  2010-06-22 23:25:55.710 metalsandmaterials[82956:207] ********** Loading AX for: xxxxxxxxx 

But trying to run it with iOS4 gives this beauty:

2010-06-22 23:15:52.488 metalsandmaterials[80149:207] ******* Accessibility Status Changed: On
  2010-06-22 23:15:52.546 metalsandmaterials[80149:207] ********** Loading AX for:   XXXXXXX  ************
  2010-06-22 23:15:53.003 metalsandmaterials[80149:207] * -[NSAutoreleasePool release]: This pool has already been released, do not drain it (double release).
  2010-06-22 23:15:53.005 metalsandmaterials[80149:207] * -[NSAutoreleasePool release]: This pool has already been released, do not drain it (double release).
  2010-06-22 23:15:53.008 metalsandmaterials[80149:207] -[UIPickerView setFrame:]: invalid height value 50.0 pinned to 162.0    

Right here! [UIIageView scale]      

2010-06-22 23:15:53.011 metalsandmaterials[80149:207] -[UIImageView scale]: unrecognized selector sent to instance 0x5ac47a0
  2010-06-22 23:15:53.013 metalsandmaterials[80149:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView scale]: unrecognized selector sent to instance 0x5ac47a0' 
Call stack at first throw:
  (
      0   CoreFoundation                      0x025f5919 exceptionPreprocess + 185
      1   libobjc.A.dylib                     0x027435de objc_exception_throw + 47
      2   CoreFoundation                      0x025f742b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
      3   CoreFoundation                      0x02567116 ___forwarding_ + 966
      4   CoreFoundation                      0x02566cd2 _CF_forwarding_prep_0 + 50
      5   UIKit                               0x0039a8e3 -[UIImageView setImage:] + 250
      6   UIKit                               0x0039b63e -[UIImageView initWithImage:] + 161
      7   UIKit                               0x05f286ce -[UIImageViewAccessibility(SafeCategory) initWithImage:] + 70
      8   metalsandmaterials                  0x0000bf09 -[TVCResults init] + 1841
      9   metalsandmaterials                  0x00002b8c -[UIVCalcHolder init] + 258
      10  metalsandmaterials                  0x00002758 -[CalcTestAppDelegate applicationDidFinishLaunching:] + 649
      11  UIKit                               0x002d759c -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1252
      12  UIKit                               0x002d99a1 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 346
      13  UIKit                               0x002e3452 -[UIApplication handleEvent:withNewEvent:] + 1958
      14  UIKit                               0x002dc074 -[UIApplication sendEvent:] + 71
      15  UIKit                               0x002e0ac4 _UIApplicationHandleEvent + 7495
      16  GraphicsServices                    0x02de1afa PurpleEventCallback + 1578
      17  CoreFoundation                      0x025d6dc4   CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 52
      18  CoreFoundation                      0x02537737 __CFRunLoopDoSource1 + 215
      19  CoreFoundation                      0x025349c3 __CFRunLoopRun + 979
      20  CoreFoundation                      0x02534280 CFRunLoopRunSpecific + 208
      21  CoreFoundation                      0x025341a1 CFRunLoopRunInMode + 97
      22  UIKit                               0x002d9226 -[UIApplication _run] + 625
      23  UIKit                               0x002e4b58 UIApplicationMain + 1160
      24  metalsandmaterials                  0x000024ac main + 230
      25  metalsandmaterials                  0x000023bd start + 53
      26  ???                                 0x00000001 0x0 + 1
  )
  terminate called after throwing an instance of 'NSException'
  Program received signal:  “SIGABRT”.
  kill
  kill  

So this scale method is new to uiimageview? why wouldn't it work? has anyone run into this already?
ANY HELP IS EXTREMELY APPRECIATED  
best regards
david

A:

You get a message "xxxxxx does not recognize selector yyyyyy" usually when an object has been released but you are still trying to use it.  At that point because the memory is random, the system thinks it's some other random kind of object (like UIImage).  Thus it's a red herring, a sign that something else is wrong and you are over-releasing an object.
There's no way you are getting those weird autorelease messages unless you are doing SOMETHING with a custom autorelease pool.  Fess up, what are you doing with an NSAutoreleasePool in your code?
I think they are probably related to the "does not recognize selector" messages since you may be over-releasing things because of this.

A:

Ok, I left if at adding a -(void)scale to a subclass of UIImageView and using this new class. Tested it, works fine on 2.2.1, 3.2 and ios4, both on simulator, iphone touch 3g with ios4 and ipad with ios3.2. 
I still need to get ahold of an iphone4 and see if some weird layout problem comes across (I still believe the problems appeared when the Os want to blow things up to the new retina display). 
Not being in the US is going to make it a tad hard though

