Cocoa/Interface Builder releases none-referenced object on NIB/XIB
Getting exceptions like
-[NSCFString yourAction:]: unrecognized selector sent to instance 0x751be30
Getting exceptions like
-[NSCFString yourAction:]: unrecognized selector sent to instance 0x751be30
menu > script (a script icon) > edit user scripts… > comments > Un/Comment Selection
#! /usr/bin/perl -w
#
# un_commentLines.pl - Comments or uncomments the selected lines
# Uses '# ' for Perl, Python, and shell scripts; '// ' otherwise
my $outputString = "";
my $perlCmt = "#";
my $cCmt = "//";
# get path to document
my $headerPath = <<'HEADERPATH';
%%%{PBXFilePath}%%%
HEADERPATH
chomp $headerPath;my $commentString;
if ($headerPath =~m/\.(sh|pl|py)$/) {
$commentString = $perlCmt;
} else {
$commentString = $cCmt;
}
my @selection = ; # read the selection from standard input
# no chars in selection, so create an empty selection
if (!@selection) {
push @selection, "";
};
# add or remove comment markers depending on the state of the first line of the selection
# if it is uncommented, comment all lines. If it is commented, remove comment markers, if present
my $firstLineOfSelection = $selection[0]; #get first line
my $addingCommentsString = 1;
if ($firstLineOfSelection =~ /^\s*$commentString/) { #selection starts with comment
$addingCommentsString = 0;
}
foreach my $line (@selection) {
if ($addingCommentsString == 1) {
$line =~ s/^(\s*)([^\s])/$1$commentString $2/;
$outputString .= $line;
} else {
$line =~ s/^(\s*)$commentString\s?/$1/;
$outputString .= $line;
}
}
print "%%%{PBXSelection}%%%";
print $outputString;
print "%%%{PBXSelection}%%%";