Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20194] iOS: Ti.Contacts unrecognized selector sent to instance

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionDuplicate
Resolution Date2016-01-19T04:21:39.000+0000
Affected Version/sRelease 5.1.2
Fix Version/sn/a
Componentsn/a
LabelsiOS, qe-5.1.2
ReporterHarry Bryant
AssigneeSrikanth Sombhatla
Created2016-01-04T23:59:43.000+0000
Updated2017-03-24T18:27:28.000+0000

Description

Description:

When calling removeGroup(); the following message is received in the console:
[INFO] :   -[CNGroup setSnapshot:]: unrecognized selector sent to instance 0x144f26760
This does not cause an error, and groups are successfully removed, however this may be worth investigating. Demo Code:
var win = Ti.UI.createWindow({
	backgroundColor: "White"
});

var newGroup = null;
var allGroups = null;
var failCase = null;

function testCase(){
	if(failCase != null) {
	return false;
	} else{
		return true;
	}
}

var createPerson = Ti.UI.createButton({
	title: 'Create Person 1',
	top: '35%'
});

createPerson.addEventListener('click', function(){
	var newPerson = Ti.Contacts.createPerson({
		firstName: 'Testing',
		lastName: '123'
		
	});
	
	Ti.Contacts.save();
});

var createGroup = Ti.UI.createButton({
	title: 'Create Test Group 1',
	top: '20%',
});

var removeGroup = Ti.UI.createButton({
	title: 'Remove Test Group 1',
	bottom: '20%'
});

var findGroup = Ti.UI.createButton({
	title: 'Find Test Group 1',
	top: '50%'
});

createGroup.addEventListener('click', function(){
	newGroup = Ti.Contacts.createGroup();
	newGroup.name = "Test Group 1";
	Ti.API.info("Test Group 1 Created!");
	Ti.Contacts.save();
});

removeGroup.addEventListener('click', function(){
	 allGroups = Titanium.Contacts.getAllGroups();
	 
        for (var i = 0; i < allGroups.length; i++) {
            Ti.API.info("found group name: " + allGroups[i].name);
            if (allGroups[i].name == "Test Group 1") {
                Ti.Contacts.removeGroup(allGroups[i]);
                
                Ti.API.info(allGroups[i].name + " Successfully Removed!");
                failCase = null;
            } else {
            	Ti.API.info("Failed to remove group: " + allGroups[i].name);
            	failCase = "Not Found";
            }
        }
       Ti.Contacts.save();
});

findGroup.addEventListener('click', function(){
	allGroups = Titanium.Contacts.getAllGroups();
	Ti.Contacts.save();
        for (var i = 0; i < allGroups.length; i++) {
            Ti.API.info("found group name: " + allGroups[i].name);
            
            if (allGroups[i].name == "Test Group 1") {
                Ti.API.info('Test Group 1 Found!');
                failCase = null;
                
            } else if(allGroups[i].name != "Test Group 1" || allGroups[i].name == null) {
            	Ti.API.info('Test Group 1 Not Found');
            	failCase = "Not Found";
            }
        }
});

win.add(createPerson);
win.add(createGroup);
win.add(removeGroup);
win.add(findGroup);
win.open();

Steps to reproduce:

1. Create a new Classic Project. 2. Use demo code provided above in app.js. 3. Tap on "Create Test Group 1" 4. Tap on "Remove Test Group 1" 5. Observe console for message.

Result:

Receive:
[INFO] :   -[CNGroup setSnapshot:]: unrecognized selector sent to instance 0x144f26760

Expected Result:

Should not receive following console message.

Comments

  1. Srikanth Sombhatla 2016-01-19

    Duplicate of TIMOB-20193
  2. Lee Morris 2017-03-24

    Closing ticket as duplicate with reference to the linked issues.

JSON Source