My problem is not related to class methods, but to objective-C functions defined in the class. These functions are intended to be called by several of the methods of the class, but there is no way that they have access to the ivars of the class (independently that the function be defined inside the @implementation or outside it). Xcode compiler gives me an error and says that the corresponding IBoutlets are not defined when using them in the function.
There is no such thing as "objective-C functions defined in the class". Their position in the class is incidental. They're exactly the same as Objective-C functions defined outside any class. And Objective-C functions are exactly the same as C functions.
Post a compilable example of one of your functions that causes a problem. Be sure to post the @interface and @implementation for the class, too.
C functions are C functions. They are not class methods or object methods. Only methods have an automatic
self reference, and implicit access to ivars (object methods only). Everything else, including all C functions no matter where they are defined, does not.
In a C function, or in any method, this notation:
is the way to reference an accessible ivar. In short, an object pointer can be used as a pseudo-struct pointer, where the pseudo-struct comprises the object's accessible ivars.
To write a C function that uses an object pointer to refer to an ivar (pseudo-struct member variable), you must write the C function with an explicit object-pointer parameter, exactly as if you were passing a real struct pointer to a function.
Only accessible ivars are accessible this way (@public or @protected). If in the @implementation of the class, then @private should also work (I think).
This is a feature of Objective-C, the language. It has nothing to do with Cocoa, the library.
See this reference doc:
http://developer.apple.com/library/....html#//apple_ref/doc/uid/TP30001163-CH12-SW1
Heading: Defining a Class > Class Implementation > Referring to Instance Variables
Also see Wikipedia's Objective-C article:
http://en.wikipedia.org/wiki/Objective-C
Find the 2nd use of
-> on the page.
You might also benefit from this:
https://developer.apple.com/library...rence/ObjCRuntimeRef/Reference/reference.html
It's not for the inexperienced, but it explains the mechanics of how Objective-C makes methods into C functions and how it calls them.