[AC-1814] [ios]imageview image doesnt accept null or ''
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-09-10T09:53:38.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | image, imageview |
Reporter | Martin Guillon |
Assignee | Anirudh Nagesh |
Created | 2012-09-05T07:29:54.000+0000 |
Updated | 2016-03-08T07:40:43.000+0000 |
Description
see the error in the console:
line = 31;
message = "invalid image type. expected TiBlob, String, TiFile, was: NSNull in -[TiUIImageView setImage_:] (TiUIImageView.m:658)";
Same error with imageView.image = null;
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var imageView = Titanium.UI.createImageView({
image:'http://www.biography.com/imported/images/Biography/Images/Profiles/J/Steven-Jobs-9354805-2-402.jpg',
width:261,
height:178,
top:20
});
imageView.addEventListener('load', function()
{
Ti.API.info('LOAD CALLED');
});
win.add(imageView);
var l = Titanium.UI.createLabel({
text:'Click Image',
bottom:30,
color:'#999',
height:'auto',
width:300,
textAlign:'center'
});
win.add(l);
function clicker()
{
var test = imageView.image;
Ti.API.info(test);
if (imageView.image && imageView.image !== '' && imageView.image !== null)
imageView.image = '';
else
imageView.image = 'http://www.biography.com/imported/images/Biography/Images/Profiles/J/Steven-Jobs-9354805-2-402.jpg';
}
imageView.addEventListener('click', clicker);
win.open();
[~farfromrefuge] We were reviewing the issues and try to reproduce this one with titanium 3.1.3. Looks like it got fixed with the newer versions as we were not able to reproduce it. Please let us know if the problem still exists or else we will close this ticket.
@Ritu: yes it has been after a merged PR https://github.com/appcelerator/titanium_mobile/commit/6a82886ce4f3208a2b3849a6934c9720d62f97f1
Closing this ticket as this issue has been resolved as per Martin's confirmation.