Can't convert String into Integer


#1

i have a hash like that :

@label_list={}

with only one key for the time being :

@label_list[“BookmarksBar”]=[]

then, the value is an Array populated like that :

@label_list[“BookmarksBar”] << folder.attributes[“label”].gsub(/"(.*)"/,
‘\1’)

then, i want to use this hash-value by :

if !@label_list[“BookmarksBar”].include?(label_) # <= line 143

this works a number of times (it’s within an each loop) until label_ =
“files” where i get :

/Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/BookmarksMer
ge.app/Contents/Resources/Controller.rb:143:in `NSApplicationMain’:
NSApplicationMain - RBException_TypeError - can’t convert String into
Integer (OSX::OCException)

label_ are always strings…

i don’t understand ))


#2

DÅ?a Pondelok 20 Február 2006 18:43 Une bévue napísal:

@label_list[“BookmarksBar”] << folder.attributes[“label”].gsub(/"(.*)"/,
/Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/BookmarksMer
ge.app/Contents/Resources/Controller.rb:143:in `NSApplicationMain’:
NSApplicationMain - RBException_TypeError - can’t convert String into
Integer (OSX::OCException)

label_ are always strings…

i don’t understand ))

I can’t reproduce this. Can you make a simple full code example where
this
happens? Otherwise, I’d blame a bug someplace else and a mysterious
off-by-one line count mishap.

David V.


#3

“Une bévue” removed_email_address@domain.invalid wrote:

@label_list[“BookmarksBar”] <<
folder.attributes[“label”].gsub(/"(.*)"/, ‘\1’)

This gsub is pretty useless as it will replace the string by itself.
What
are you trying to do here?

NSApplicationMain - RBException_TypeError - can’t convert String into
Integer (OSX::OCException)

label_ are always strings…

i don’t understand ))

Me too. What libraries are you using? If @label_list is a normal Hash
and
the entry is a normal Array, as your code snippets suggest, then I can’t
see
how this error can occur. Seems we need more information…

Kind regards

robert

#4

Quoting Robert K. removed_email_address@domain.invalid:

folder.attributes[“label”].gsub(/"(.*)"/, ‘\1’)

This gsub is pretty useless as it will replace the string by itself. What
are you trying to do here?

It strips the double quotes.

David V.


#5

removed_email_address@domain.invalid schrieb im Newsbeitrag
news:removed_email_address@domain.invalid…
Quoting Robert K. removed_email_address@domain.invalid:

folder.attributes[“label”].gsub(/"(.*)"/, ‘\1’)

This gsub is pretty useless as it will replace the string by itself. What
are you trying to do here?

It strips the double quotes.

Blind I am. Gosh! Thanks for clearing the fog from my brain.

robert

#6

David V. removed_email_address@domain.invalid wrote:

Otherwise, I’d blame a bug someplace else and a mysterious
off-by-one line count mishap.

Right their was a big bugg of roughly 80 Kg :
the guy betwwen my chair and the computer :wink:

in fact the error wasn’t directly coming from the line given by ruby ))


#7

Robert K. removed_email_address@domain.invalid wrote:

Blind I am. Gosh! Thanks for clearing the fog from my brain.

:wink:

in fact i want to synchronize safari and firfox bookmaks on the safari
side some of them are written :

“Swing”

the equivalent on firefox being written :

Swing

then, i wipe out the difference;;;


#8

DÅ?a Utorok 21 Február 2006 19:48 Une bévue napísal:

David V. removed_email_address@domain.invalid wrote:

Otherwise, I’d blame a bug someplace else and a mysterious
off-by-one line count mishap.

Right their was a big bugg of roughly 80 Kg :
the guy betwwen my chair and the computer :wink:

Those things are arguably the largest source of bugs in any software
development process. We should get rid of them one of these days and use
something more reliable.

Time to develop the Programmer 2.0 cackle.

This would arguably be funnier if them strange SW architect people
didn’t try
to make UML executable over and over again. fears for his cushy geek
career

David V.