Skip navigation.
 
mlRe: A Question about [[self superview] doSomething]
FROM : Daniel DeCovnick
DATE : Tue Apr 26 20:51:31 2005

On Apr 26, 2005, at 1:00 PM, Brian O'Brien wrote:

> I have manage to get this to work for me until doSomething needs
> parameters, then the application crashes when the method is called.
>
> Also I'm getting a warning  `NSView' may not responde to
> `-doSomething:'
> can not find method `-doSomething:'; return type `id' assumed


In Objective-C you need to declare -doSomething and -doSomething: (and
-doSomething:withSomethingElse: or -doSomething:: (infix parameter
descriptors are not strictly necessary, just insanely useful))
separately in your class. The colon is very significant. What you can
also do is just have a doSomething method with as many args as you may
need and simply have default values for them in case the sender passes
nil.

> my superview in this case is a subclass of NSView and has a method
> called doSomething.
> Which works fine if no parameters are passed..
>
> In C and C++ you can define function prototypes for external methods. 
> Can you do
> the same in ObjectiveC?


If you can do it in C (not necessarily C++), you can do it in
Objective-C.

> By does anyone know of a group for PyObjC?


I don't, sorry. But others on this list might.

-Dan



Daniel DeCovnick
danhd123 at mac dot com
Softyards Software
http://www.softyards.com

Related mailsAuthorDate
mlA Question about [[self superview] doSomething] Brian O'Brien Apr 26, 19:00
mlRe: A Question about [[self superview] doSomething] Shawn Erickson Apr 26, 19:22
mlRe: A Question about [[self superview] doSomething] Daniel DeCovnick Apr 26, 20:51
mlRe: A Question about [[self superview] doSomething] Ronald Oussoren May 6, 20:00