Nuts are generally great for weight loss. Almonds, pistachios, walnuts, peanuts, and yes, cashews should be good for you, if you're eating these to keep you full. Generally, 1 ounce of nuts = ~135 calories, though that still depends on your nut of choice. Personally, I eat nuts to replace a meal, so I'm full, keep any cravings I have at bay, and get a chock full of nutrients my body needs. Add some protein and you're all good.
As with everything else, moderation is the key. Anything excessive would of course, not be good for you. Perhaps you just ate larger portions of the nuts, or ate them with some other (not so healthy) food - and that's why you gained weight. Not really sure.
At any rate, don't be discouraged. Continue to try to find what works for you.
Should you wish to, you can visit this link for a Free ebook on how to motivate yourself into achieving your weight loss goals.
http://asktravers.clkpfct.com/go/wwl-optin
All the best!
___________
Lose the Excuses, Lose the Weight
http://asktravers.clkpfct.com/go/wwl-optin