|
Is there any functional programming library for Objective-C?
Started by luvieere on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
It is a set of low level functional types & APIs.
Objective-C is not a functional programming language (it is quite clearly procedural OO), so is an attempt to use functional paradigms in Objective-C.
|
|
I am writing an Objective-C class but is uses an API written in C. This is mostly fine as mixing C calls with Objective-C calls causes few problems.
However one of the API call requires a call back method (example):
success = CFHostSetClient(host, MyCFHostClientCallBack...
Started by rjstelling on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
To call Objective-C code; } - (void) someMethod....
As in the example , this can be manipulated with normal Objective-C make a C function that calls Obj-C delegate methods on other objects.
C object to the C function.
|
|
Do all functions (as opposed to class/instance methods) in Objective-C use C syntax for both declaration and calling?
Started by Casebash on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Objective-C is a superset of C, meaning that you can use any C construct you want and the compiler.
Well, it really is C.
Objective-C is built on top of C, so the C syntax is valid.
Yes, they do.
|
Ask your Facebook Friends
|
Hey folks,
I just read this http://stackoverflow.com/questions/2172887/use-c-struct-in-objective-c question, and I was wondering why anyone would want to use function pointers in structs. Wouldn't wrapping the functions in a class be equivalent?
Started by x3ro on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
The only reasons I can think of doing....
Function pointers are used like that in C for creating polymorphic behavior, sort of a poor man's object.
C structures with function pointers but you should be okay with using objective-c.
|
|
I am trying to write a function which returns a string created from two input strings;
but when I try the function declaration
NSString Do_Something(NSString str1, NSString str2) { }
the compiler gets sick. (Worked fine for a different function with int...
Started by John R Doner on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
See my answer to C function always returns zero to Objective CAll Objective....
In mind that this is a (C-style) function and not an instance method written on an Objective-C object earn some of the language's benefits).
|
|
I want to make a file that contains useful functions for my project. Well, I know that I can define a function inside my class implementation. But I don't really get it... I mean: I don't want to create a "class", just functions. Or are functions always...
Started by Thanks on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Let Xcode manage ....
Include your header file wherever you need one of your functions.
A body file (.c) containing all function bodies.
Organize your code in plain old C style:
a header file (.h) containing all function declarations.
|
|
I have an Objective C project incorporating a C file with some helper functions. I have a grave and very irritating problem trying to return float s from the C file.
C file:
float returnFloat() { return 10.0; }
Meanwhile in an Objective C instance method...
Started by Benji XVI on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
You're mixing C function prototypes with Objective-C revision of his post, he was mixing the C way of writing function prototypes with the Objective-C way of writing....
]; // assuming this is an object
Not what you have.
|
|
When using XCode for writing for the iphone SDK... like a simple function that accepts a text-string URL and visits the website, and returns the HTML... which is better?
Use Objective-C and write a "method" that accepts an NSString and returns an NSString...
Started by Donna on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
For your particular example, you could probably get.
Unless performance is a serious concern to wrap it in Objective-C to work on the iPhone.
Typically you would write new iPhone code in Objective-C.
|
|
When reading Best way to define private methods for a class in Objective-C I end up with a programming style doubt. Which is the better solution (in terms of style) to this problem? To use a category and declare it in the @interface directive in the ....
Started by GuidoMB on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
…
If you are using Objective-C 2.0, you should instead declare a method and you do not need to have any....
The Google Objective-C Style Guide says ,
Use a private category to prevent cluttering the public header.
Categories are the way to go.
|
|
Hi, I am using MVC architecture for a GUI application. The model class has some C functions. One of the C functions calls some methods of Objective-C class. I call those methods using an object of that class. The strange thing happening is that methods...
Started by shrads on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Here's a working sample of CYou can definitely run methods on Obj-C objects from a C function, so it's likely there's an error in your code at some point....
To the OBJC object that is un-initialised outside the objective-c scope.
|