Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1814] [ios]imageview image doesnt accept null or ''

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2012-09-10T09:53:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsimage, imageview
ReporterMartin Guillon
AssigneeAnirudh Nagesh
Created2012-09-05T07:29:54.000+0000
Updated2016-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();

Comments

  1. Ritu Agrawal 2013-12-13

    [~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.
  2. Martin Guillon 2013-12-14

    @Ritu: yes it has been after a merged PR https://github.com/appcelerator/titanium_mobile/commit/6a82886ce4f3208a2b3849a6934c9720d62f97f1
  3. Ritu Agrawal 2013-12-15

    Closing this ticket as this issue has been resolved as per Martin's confirmation.

JSON Source