This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
1 Replies Last post: Jul 18, 2013 12:14 PM by Anton Makeev  
Steve Malsam Newbie 4 posts since
Apr 6, 2011
Currently Being Moderated

Jul 16, 2013 12:49 AM

Evaluate expression not allowing me to create new objects

I'm trying to debug something with Core Data really quick, and so I was going to use the Evaluate Code Fragment thingy to execute a fetch. However, when I try to alloc/init the NSFetchRequest, it tells me that there is "no known method 'init'; cast the message send to the method's return type." Is there a trick to instantiating new objects in the Evaluate Expresstion code fragment mode, or can this simply not be done?

Anton Makeev JetBrains 1,291 posts since
Dec 19, 2006
Currently Being Moderated
Jul 18, 2013 12:14 PM in response to: Steve Malsam
Re: Evaluate expression not allowing me to create new objects

Steve,

 

Evaluate Code Fragment feature currently doesn't implicitly cast expression to the expected type (while Evaluate Expression does) and you need to to so explicitly, since neither GDB not LLDB can determine the type of the returning object for Objective-C methods calls.

 

We plan to improve Code Fragment mode in future updates, meanwhile you can either switch to Expression mode, or manually cast each method call to the returning value, e.g. (id)[(id)[NSFetchRequest alloc] init].

More Like This

  • Retrieving data ...