FROM : Joshua Emmons
DATE : Wed Nov 07 02:30:45 2007
One of the dot syntax "Usage Summaries" from "The Objective-C 2.0
Programming Language" is:
xOrigin = aView.bounds.origin.x;
This leads me to believe that I can replace the following code:
-(void)viewClicked:(id)sender{
NSSize size = [sender bounds].size;
size.height *= 2;
[[sender animator] setBoundsSize:size];
}
with something like:
-(void)viewClicked:(id)sender{
NSSize size = sender.bounds.size;
size.height *= 2;
sender.animator.boundsSize = size;
}
However, when I do so, I get errors like "request for member 'bounds'
in something not a structure or a union". It sounds to me like the
compiler has no idea what's going on with the dot there. Or, at least,
it's definitely not [sender bounds], which is what I would have
expected. What am I overlooking here?
Many thanks,
-Joshua Emmons
DATE : Wed Nov 07 02:30:45 2007
One of the dot syntax "Usage Summaries" from "The Objective-C 2.0
Programming Language" is:
xOrigin = aView.bounds.origin.x;
This leads me to believe that I can replace the following code:
-(void)viewClicked:(id)sender{
NSSize size = [sender bounds].size;
size.height *= 2;
[[sender animator] setBoundsSize:size];
}
with something like:
-(void)viewClicked:(id)sender{
NSSize size = sender.bounds.size;
size.height *= 2;
sender.animator.boundsSize = size;
}
However, when I do so, I get errors like "request for member 'bounds'
in something not a structure or a union". It sounds to me like the
compiler has no idea what's going on with the dot there. Or, at least,
it's definitely not [sender bounds], which is what I would have
expected. What am I overlooking here?
Many thanks,
-Joshua Emmons
| Related mails | Author | Date |
|---|---|---|
| Joshua Emmons | Nov 7, 02:30 | |
| mmalc crawford | Nov 7, 02:40 | |
| listposter | Nov 7, 03:14 | |
| Ali Ozer | Nov 7, 03:32 | |
| Andre | Nov 7, 06:32 |






Cocoa mail archive

