Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
Noob question here, so please help :) I really dont understand the way to call methods in objective-c. this is what i got...
so lets say we're in the header file of a class and i want to make a new view. would i declare a method like this (not necessarily a addSubview method, just any one in general.
-(void)addSubview:(UIView *)view
and then in the implementation file i would implement that as
EDIT: Having read your "in general" part, sure, you could define a method like that (but don't name it exactly that). The problem with that approach is that you got it the wrong way round. Seeing the declaration I would expect the method called on a view would add the view passed as the parameter as the subview. Instead you are just creating a new view to the pointer being passed.
Replies
Btw, this document is an excellent summation of the basic syntax and principles of ObjC: http://developer.apple.com/library/ios/#referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/_index.html There's a great, but much longer, and thorough guide on Objective C in the documentation as well.
EDIT: Having read your "in general" part, sure, you could define a method like that (but don't name it exactly that). The problem with that approach is that you got it the wrong way round. Seeing the declaration I would expect the method called on a view would add the view passed as the parameter as the subview. Instead you are just creating a new view to the pointer being passed.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome