I'm working on a framework, mostly for learning but partly because I had something I want to be able to use, but I realized I don't really know how to make methods. I've used various kinds, but I don't really know what anything is or how to make one with multiple values etc..
First, what's the difference between (id) and (void)? I know that part of the method specifies what kind of object is accepted when the method is called, but I don't see the difference between those two.
Now for the real question. Here's how I want my currently fictional method:
- (void)animateIntValueTo:_____ atSpeed:_____ {
}
What goes in those blanks? I know in the documentation, it would do something like: (int)anInt or (NSNumber *)aNumber but doing either of those gave me an error, something like 'NSNumber has already been defined' or something like that. Do I need to put variables/objects declared in my header in the blank spaces? If not, how do I get the values the user puts in the slots?
Thanks in advance,
Nate
First, what's the difference between (id) and (void)? I know that part of the method specifies what kind of object is accepted when the method is called, but I don't see the difference between those two.
Now for the real question. Here's how I want my currently fictional method:
- (void)animateIntValueTo:_____ atSpeed:_____ {
}
What goes in those blanks? I know in the documentation, it would do something like: (int)anInt or (NSNumber *)aNumber but doing either of those gave me an error, something like 'NSNumber has already been defined' or something like that. Do I need to put variables/objects declared in my header in the blank spaces? If not, how do I get the values the user puts in the slots?
Thanks in advance,
Nate