What is the difference between "+" and "-" before the function name interface declaration in an Objective-C program. Example:
What's the difference?
Being an aspiring Apple developer, I want to get the opinions of the community if it is better to learn C first before moving into Objective-C and ultimately the Cocoa Framework?
My gut says learn C, which will give me a good foundation.
How to call a function in Objective C? For example:
I define the function in header (.h file):
and implement this function in implementation file (.m file):
Now how would I call this function from where I need it?
Does someone here knows a face detection API for Objective-C? I just want to detect one or more faces inside a photo, so it's not necessary face recognition.
I want to build something similar to the iPhoto's feature that puts a square on all faces in a photo.
It would be nice if the API can be used on iPhone apps too.
Is there a nice way to do this in Objective-C, or do I have to write my own tedious logic?
I'm creating and destroying a little of little state objects per frame in an iPhone game. It would be nice if I could just reuse objects from a pool.
Where should I place utility methods in objective-c?
E.g. additional path handling utility methods which are called by multiple classes.
I have seen examples where they are placed in the main appdelegate file and are therefore available to all. This seems a bit weird to me though however...
Are there any shortcuts to (stringByAppendingString:) string concatenation in Objective-C or shortcuts for working with NSString or other objects in general?
e.g. I'd like to make this:
NSString *myString = @"This";
NSString *test = [myString stringByAppendingString:@" is just a test"];
something more like this:
string myString = "This";
string test = myString + " is just a test";
I have a critical method in an Objective-C application that I need to optimize as much as possible. I first need to take some easy benchmarks on this one single method so I can compare my progress as I optimize.
What is the easiest way to track the execution time of a given method in, say, milliseconds, and print that to console.
What is the best practice, even in general programming, when you have an undefined, possibly infinite, amount of items that you need in an array but don't have defined bounds. Can you define an endless array in objectivec that you can keep pushing items onto, like other lanaguages have a list item.
Thanks for any help.
I've been developing for Visual Studio and C# for a long time. Now, I'm developing with XCode and Objective-C.
On C# I can use /// <summary> to generate documentation. Is there any kind of mechanism like that on XCode to generate documentation? And what kind of comments should I use?
I am making an iPhone app. I have a code that is in C. The C code contains a lot of pointers and global variables. I want to use this C code in my objective-c project. Can anybody please help me with this?
So I thought that negative numbers, when mod'ed should be put into positive space... I cant get this to happen in objective-c
I expect this:
-1 % 3 = 2
0 % 3 = 0
1 % 3 = 1
2 % 3 = 2
But get this
-1 % 3 = -1
0 % 3 = 0
1 % 3 = 1
2 % 3 = 2
Why is this and is there a workaround?
Let's say I have this:
NSString *str = @"This is a sample string";
How will I split the string in a way that each word will be added into a NSMutableArray?
In VB.net you can do this:
Dim str As String
Dim strArr() As String
Dim count As Integer
str = "vb.net split test"
strArr = str.Split(" ")
For count = 0 To strArr.Length - 1
So how to do this in Objective-C? Thanks
I know Objective-C is just a superset of C, and you can use plain C anywhere. But am I able to use .m and .c files (for when there is only pure C) in the same project? Or all the errors I'm getting because of something else…
In Java, I may have a class, for example, "utility" ....., and I have a static method called "changeToCapitalLetter", so , I can do something like this:
How can I do the similar thing in Objective C? thz a lot.