I need to know what is happening when extra bits of information are passed around through method titles in xcode ie:
- (CGPDFPageRef)pdfPage:(NSInteger)index {
and
- (void)configurePageP:(ISVportrate *)page forIndex:(NSUInteger)index{
开发者_运维百科
when this happens it is a little annoying that I don't know whats going on or feel comfortable passing messages this way my self.
for example my app is made from some code chunks stuck together in a voodoo manner, one part of my app passes a message to a class this way... but the class only declares NSInteger index but never uses it:
@interface ImageScrollView : UIScrollView <UIScrollViewDelegate> {
NSUInteger index;
}
@property (assign) NSUInteger index;
@end
@implementation ImageScrollView
@synthesize index;
@end
I would really like to research this, can someone please point me in the right direction.
Thanks
It's just passing arguments with the message, similar to how printf("Hello\n")
passes "Hello\n"
to the printf
function.
Apple's free The Objective-C Programming Language explains this very well, in addition to many other concepts that are important for you to feel confident in understanding Objective-C code. The first chapter after the introduction is actually on this very topic.
精彩评论