Monday, December 11, 2017

#1 2016-01-25 04:49:10 pm

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 642

awakeFromNib & registerForDraggedTypes_ question

Hi
I have a trash can in my project that when you drop an item on it, it will send that item to the trash, works great.

when I compile the application I keep getting this error, yet it doesn’t effect anything.


Is there any thing I can do to get rid of this error?, an alternative to the awakeFromNib maybe.

[DROPTRASH awakeFromNib]: mainTrashWindow of «script» doesn’t understand the “registerForDraggedTypes_” message. (error -1708)


Budgie

"Our greatest glory is not in never falling, but in rising every time we fall"    - Batman

Offline

 

#2 2016-01-25 06:42:47 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5197

Re: awakeFromNib & registerForDraggedTypes_ question

Is this a recent project? Can you check whether Prefer coder is checked for the nib?


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#3 2016-01-25 07:22:43 pm

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 642

Re: awakeFromNib & registerForDraggedTypes_ question

thanks for replying Shane

The project has been growing since it’s inception back in 2008, I have
upgraded the versions of Xcode and adapted over the years to keep as current
as possible, this latest build is using Xcode 7.2 on OS X 10.11.3.

The “Prefer coder” check box was unchecked, I checked it and did another build
the issue still remains.

The area used to drop the item onto is a custom class linked with a outlet.

I have seven errors thrown when I do a build and they all come from the same sort of set up
used for drag and drop in different parts of my app, apart from that no other errors show at build time.

Last edited by Budgie (2016-01-25 07:25:31 pm)


Budgie

"Our greatest glory is not in never falling, but in rising every time we fall"    - Batman

Offline

 

#4 2016-01-25 09:13:39 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5197

Re: awakeFromNib & registerForDraggedTypes_ question

Find where you call registerForDraggedTypes_, and insert this before it:

Applescript:

current application's NSLog("mainTrashWindow is %@", mainTrashWindow)

Then see what gets logged.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#5 2016-01-25 09:22:08 pm

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 642

Re: awakeFromNib & registerForDraggedTypes_ question

Applescript:

2016-01-26 15:21:01.852 BLACK MASK[55359:3442785] mainTrashWindow is (null)
2016-01-26 15:21:01.852 BLACK MASK[55359:3442785] *** -[DROPTRASH awakeFromNib]: mainTrashWindow of «script» doesn’t understand the “registerForDraggedTypes_” message. (error -1708)
2016-01-26 15:21:01.854 BLACK MASK[55359:3442785] mainTrashWindow is <DROPTRASH @0x100110910: OSAID(336) ComponentInstance(0x810000)>


Budgie

"Our greatest glory is not in never falling, but in rising every time we fall"    - Batman

Offline

 

#6 2016-01-25 10:44:15 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5197

Re: awakeFromNib & registerForDraggedTypes_ question

Check that mainTrashWindow is connected to what you think it is in Xcode. That doesn't look right to me.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#7 2016-01-26 01:50:14 pm

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 642

Re: awakeFromNib & registerForDraggedTypes_ question

ok, did that and all is connected as it should be, BUT!
what I did find though is, when I right clicked on the blue cube “DROP TRASH”
the outlet mainTrashWindow” is definitely connected to the box it is supposed to
be connected to, but if I click on the “Show the Connections Inspector” top right
the “mainTrashWindow “ doesn’t show as being connected, if I connect it also from there
and build the error goes away, this odd behaviour

Forgot to add, that even though it compiles, and the error goes away, the drag and drop stops working.

back to the drawing board

Last edited by Budgie (2016-01-26 02:47:27 pm)


Budgie

"Our greatest glory is not in never falling, but in rising every time we fall"    - Batman

Offline

 

#8 2016-01-26 07:41:56 pm

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 642

Re: awakeFromNib & registerForDraggedTypes_ question

went back and made new box's an hooked them all up, drag and drop still works fine, but i'm still
getting the same errors thrown in the log.

I guess as long as it's working and it doesn't appear to be failing any where i'll have to live with this.

thanks Shane for your input.


Budgie

"Our greatest glory is not in never falling, but in rising every time we fall"    - Batman

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)