| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
David is right about returning a pointer, you probably only need to return obj since obj is most likely a pointer to an object anyway. You'd only need to return *obj if obj is a pointer to a pointer to an object. I guess you don't want to return &obj since that would be an object ** and your method is declared as returning an object *._______________________________________________
Anyway, here's my contribution: you are not calling the right function. -function: as you have implemented it takes an argument, but you are calling a method -function which does not take any arguments. You should call it like this:
obj2=[outlet function:self];
but since function: does not do anything with the argument, you could get rid of it altogether, and change it to:
declaration:
- (object *) function;
implementation:
-(object *) function
{
return obj;
}
call:
obj2 = [outlet function];
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| References: | |
| >Re: passing pointers (From: Angela Brett <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.