Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSKeyedUnarchiver error #23

Closed
igorms-pro opened this issue May 6, 2014 · 29 comments
Closed

NSKeyedUnarchiver error #23

igorms-pro opened this issue May 6, 2014 · 29 comments
Milestone

Comments

@igorms-pro
Copy link

Hello,

In (UIView_) copyOfView:(UIView_) viewToCopy function
{
...

NSData* viewCopyData = [NSKeyedArchiver archivedDataWithRootObject:viewToCopy];
    UIView* viewCopy = [NSKeyedUnarchiver unarchiveObjectWithData:viewCopyData];

...
}
, i am having this issue: " [NSKeyedUnarchiver decodeBoolForKey:]: value for key (UIHighlighted) is not a boolean' "....
Its happening when i DOUBLE TAP on my item AND THEN try TO DRAG

After little research, some people fixed the problem with unsetting Highlighted but its not working for me....

Please, how i have to implement some double Tap function for ignoring double tap.

@SteveFortune
Copy link
Member

Hi!

I think this is documented somewhere... I had this exact same issue and remember passing on a fix to someone. Let me see if I can dig it out.

@igorms-pro
Copy link
Author

Okay thanks you because Im going crazy with this...

@SteveFortune
Copy link
Member

@snakelecaps, are you using a custom UI[ TableView | CollectionView ]Cell ?

@igorms-pro
Copy link
Author

@SteveFortune Yes

@SteveFortune
Copy link
Member

@snakelecaps are you able to share the code for your custom cell class ? I know there are some issues with custom cells (see #8).

@igorms-pro
Copy link
Author

I can not share with you the entire classe (Code & Etics) but perhaps a small part of if.
Im currently not on my mac computer so i will share later.
I will read your link , thanks.

@SteveFortune
Copy link
Member

Ok, speak soon !

@igorms-pro
Copy link
Author

hi,

UICollectionView *productsCollectionView;
UITableView *tableview;

i

Im going to check your link right now
Thanks

@igorms-pro
Copy link
Author

Im trying using Nscoder instead of NSKeyedArchiver but i dont know where to put i? in my controller.m or I3DragBetweenHelper.m ?

@SteveFortune
Copy link
Member

Check out the new code snippet provided an as example in the Example directory (on the dev branch).

@igorms-pro
Copy link
Author

i read it, nice example thanks you.
But i dont know how and where implement this class?
Do i have to modify your I3DragBetweenHelper Class ?
Do i have to put in my class where i create tableView?

Thanks

@igorms-pro
Copy link
Author

And like i said, this is not working ONLY when i double tap on my item and try to drag...
Simple drag works... :-)

@SteveFortune
Copy link
Member

Are you using the latest version of the library on master?

@igorms-pro
Copy link
Author

yep, but i did like i said to you in the first place, i catched some gesture...
The thing with Nscoder was so troublesome and i dont have much time.
ps: and i m a beginner on IOS :-)

@SteveFortune
Copy link
Member

I will see if I can recreate the issue. Are you running the app on a Simulator or actual device? What version of iOS is the device ?

@igorms-pro
Copy link
Author

Im running in iphone 5 IOS 7.1
Please how to disabled the selection (grey background) of a items (TableView)

@SteveFortune
Copy link
Member

This might help

@igorms-pro
Copy link
Author

I see, maybe i can add the line before
cellCopy = [self copyOfView:cell]; Line 323 and 329?

@SteveFortune
Copy link
Member

You should not need to modify the helper class, you could trying 'turning off' highlighting for each cell in your controller's tableView:cellForRowAtIndexPath:

@igorms-pro
Copy link
Author

Nicem its working - thanks you

@SteveFortune
Copy link
Member

Great. Closing this issue now.

@jamesince
Copy link

Hi Steve,

I am having the same crash issue " [NSKeyedUnarchiver decodeBoolForKey:]: value for key (UIHighlighted) is not a boolean' ".... when taping once then tap again to drag. But I am using UICollectionView in my case. I try the above solution to set in 'cellForItemAtIndexPath' : setHighLighted:NO or setSelected:NO, nothing could stop from crashing. In my Custom Cell, I have only a UIImageView. The only thing I can do is to set cell 'setUserInteractionEnabled:NO'. By doing this I still can drag n drop but I need to perform an action when user taps. Could you help please?

Many thank in advance! Your helpers in great.
James.

@SteveFortune
Copy link
Member

Hi !

I'll reopen this and have another look. I know it was definately an issue in one of my apps.

It might be a case of finding an alternative to the NSKeyed[ Archiver | Unarchiver ].

Thanks!

@SteveFortune SteveFortune reopened this May 18, 2014
@igorms-pro
Copy link
Author

I'd try Nscoder but....

@jamesince
Copy link

Many thanks Steve for opening again this issue.

Additional details, the issue happens in both src and dest UICollectionView when taping once and tap again to drag.

I am a beginner in iOS, If this could help other people who are facing the same problem, my temporary workarround for my case is to create a UIButton to cover the Cell. I set the Button background to clear color. When the button is tapped, I trigger a method to perform what I want. So the Cell heighlignting or selecting will never get called (so no crash).

I know this goes against the purpose of delegate method 'collectionView:didSelectItemAtIndexPath:' until we have a fix.

Regards,
James.

@SteveFortune
Copy link
Member

Just ad update - I've scheduled some maintenance time this coming Sunday to work on this issue. Sorry its been so long, haven't had much time to work on this lately.

@SteveFortune
Copy link
Member

See comments on #29 for progress

@SteveFortune
Copy link
Member

See most recent comment on #29

@SteveFortune
Copy link
Member

Fixed for v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants