Bug 23305 - Invalid binding for +[UIImage animatedResizableImageNamed:capInsets:duration:]
Summary: Invalid binding for +[UIImage animatedResizableImageNamed:capInsets:duration:]
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 7.2.6
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2014-09-23 15:49 UTC by Adam Kemp
Modified: 2014-09-25 15:02 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Example project (8.10 KB, application/zip)
2014-09-23 15:49 UTC, Adam Kemp
Details
Real example (9.77 KB, application/zip)
2014-09-25 15:02 UTC, Adam Kemp
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Adam Kemp 2014-09-23 15:49:11 UTC
Created attachment 8159 [details]
Example project

The method +[UIImage animatedResizableImageNamed:capInsets:duration:] is bound as this static method in UIImage:

public static UIImage CreateAnimatedImage(UIImage[] images, UIEdgeInsets capInsets, double duration)

The first argument is an array of images, but it should be just a string. As a result the method doesn't work. Oddly, it didn't crash as I expected it to, but it just didn't work.

I've attached an example project. If you run it you will see just a white screen. Look at AnimationTestViewController.ViewDidLoad to see the code that doesn't work.
Comment 1 Sebastien Pouliot 2014-09-23 20:53:15 UTC
Ouch, you're right the binding is incorrect. I suspect it was an (old 2011) copy-paste error, e.g. "animatedImageWithImages:duration:" accept an array of UIImage.

We'll fix that and obsolete the old/broken API.
Comment 2 Sebastien Pouliot 2014-09-25 13:30:40 UTC
Fixed in master 9c49b1284ab41b3ba29a0210d99d16d7b5813c89

QA: unit tests added in the same revision (note: attached sample does not call the code, likely a wrong upload)
Comment 3 Adam Kemp 2014-09-25 15:02:03 UTC
Created attachment 8189 [details]
Real example

Oops. I was off by one when attaching a sample project. Real example attached for posterity.

Thanks!