Agreed.
I just meant in the general case.
ScottB
On Oct 13, 2011, at 11:30 , David Rowland wrote:
However, if the property is readonly I think you must use direct access to
set an initial value. The setter does not exist.
David Rowland
On Oct 13, 2011, at 10:54 AM, Bayes Scott F
Thank you, David.
Sounds like safety first for my code: always use the setter/getter for
synthesized properties, even in self.
Or use ivars.
ScottB
On Oct 12, 2011, at 09:21 , Bayes Scott F wrote:
Someone on Matt's site mentioned the possibility that the synthesized ivar
could be
However, if the property is readonly I think you must use direct access to set
an initial value. The setter does not exist.
David Rowland
On Oct 13, 2011, at 10:54 AM, Bayes Scott F wrote:
Thank you, David.
Sounds like safety first for my code: always use the setter/getter for
Someone on Matt's site mentioned the possibility that the synthesized ivar
could be implemented indirectly, say as a member of a collection. Since the
implementation's opaque, we don't know if that ever can happen.
So, is self-mySynthIvar safe (both lvalue and rvalue), or should we be
On Oct 12, 2011, at 9:21 AM, Bayes Scott F wrote:
Someone on Matt's site mentioned the possibility that the synthesized ivar
could be implemented indirectly, say as a member of a collection. Since the
implementation's opaque, we don't know if that ever can happen.
I can't say that I know
Thank you, David, that's pretty clear.
Sounds like safety first for my code: always use the setter/getter for
synthesized properties, even in self.
Or use @private ivars.
ScottB
On Oct 12, 2011, at 09:46 , David Duncan wrote:
On Oct 12, 2011, at 9:21 AM, Bayes Scott F wrote:
Someone on
On Oct 12, 2011, at 9:21 AM, Bayes Scott F wrote:
Someone on Matt's site mentioned the possibility that the synthesized ivar
could be implemented indirectly, say as a member of a collection. Since the
implementation's opaque, we don't know if that ever can happen.
A property may be
Thanks, Greg.
ScottB
On Oct 12, 2011, at 12:12 , Greg Parker wrote:
On Oct 12, 2011, at 9:21 AM, Bayes Scott F wrote:
Someone on Matt's site mentioned the possibility that the synthesized ivar
could be implemented indirectly, say as a member of a collection. Since the
implementation's
On Fri, 07 Oct 2011 19:46:17 -0400, Andy Lee ag...@mac.com said:
On Oct 3, 2011, at 2:23 PM, Charles Srstka wrote:
2. KVOs access instance variables directly (mis)feature recognizes the
underscore prefix. I like to give it a prefix that KVO doesnt know about so
that I can be sure never to
On Oct 11, 2011, at 9:57 AM, Matt Neuburg wrote:
I did everything right when I named an ivar firstResponder (property,
synthesized ivar, synthesized accessors) and totally broke my app because
Apple was apparently already using an undocumented ivar called
firstResponder.
On Mon, 3 Oct 2011 13:23:25 -0500, Charles Srstka said:
1. Apple reserves the underscore prefix for their own use, so you could,
at least theoretically, clash with a superclass ivar this way, and
In addition to what Kyle replied, I'd just like to point out that prefixing
your *methods* with an
In addition to what Kyle replied, I'd just like to point out that prefixing
your *methods* with an underscore is a very bad idea, since Apple does
reserve such names and a conflict will bite you at runtime possibly affecting
the binary compatibility of your app.
I would argue that
On Oct 7, 2011, at 9:40 AM, Sean McBride wrote:
On Mon, 3 Oct 2011 13:23:25 -0500, Charles Srstka said:
1. Apple reserves the underscore prefix for their own use, so you could,
at least theoretically, clash with a superclass ivar this way, and
In addition to what Kyle replied, I'd just
On Fri, 7 Oct 2011 10:21:41 -0700, Glenn L. Austin said:
Do I really need to quote the C and C++ standards that states that a
leading underscore on a symbol is reserved to the implementation -- in
other words 'the implementation' is everything that you're not writing?
ISO/IEC 9899:1999, Section
On Oct 7, 2011, at 11:40 AM, Sean McBride wrote:
On Mon, 3 Oct 2011 13:23:25 -0500, Charles Srstka said:
1. Apple reserves the underscore prefix for their own use, so you could,
at least theoretically, clash with a superclass ivar this way, and
In addition to what Kyle replied, I'd just
On Oct 3, 2011, at 2:23 PM, Charles Srstka wrote:
2. KVO’s “access instance variables directly” (mis)feature recognizes the
underscore prefix. I like to give it a prefix that KVO doesn’t know about so
that I can be sure never to end up accidentally accessing the ivars of
another object
Hello,
I have a question about release/retain and properties. Now I get the
whole if you allocate it, you have to release
it, but with properties I need some clarification. I'm using an
AVAudioPlayer to play a sound, and I'm initializing
it in the viewDidLoad by calling a routine to get the sound.
At 10:14 AM -0400 10/3/11, John Tsombakos wrote:
@interface AudioPlayerViewController : UIViewController {
AVAudioPlayer *audioPlayer;
}
@property (retain) AVAudioPlayer *audioPlayer;
In the .m file:
@synthesize audioPlayer;
in viewDidLoad:
audioPlayer = [self getSoundFile:soundfile.wav];
You
Not enough morning coffee for you,
On Oct 3, 2011, at 7:29 AM, Steve Sisak wrote:
You do, indeed want:
self.audioPlayer = [self getSoundFile:soundfile.wav];
or
[self setAudioPlayer = [self getSoundFile:soundfile.wav]];
I think you meant [self setAudioPlayer:[self
On Mon, Oct 3, 2011 at 10:29 AM, Steve Sisak sgs-li...@codewell.com wrote:
At 10:14 AM -0400 10/3/11, John Tsombakos wrote:
@interface AudioPlayerViewController : UIViewController {
AVAudioPlayer *audioPlayer;
}
@property (retain) AVAudioPlayer *audioPlayer;
In the .m file:
@synthesize
Am 03.10.2011 um 16:14 schrieb John Tsombakos:
audioPlayer = [self getSoundFile:soundfile.wav];
...
in getSoundFile routine:
AVAudioPlayer *snd;
...
snd = [[[AVAudioPlayer alloc] initWithContentsOfURL:url error:error]
The question was already answered, but I wanted to point out that the
On Oct 3, 2011, at 10:14 AM, John Tsombakos wrote:
(and will also change to use the underscore ivar names too - I had done that
previously, but...well, didn't this time.)
I recommend using some other prefix system instead of the underscore, for two
reasons:
1. Apple reserves the underscore
On Mon, Oct 3, 2011 at 11:23 AM, Charles Srstka
cocoa...@charlessoft.com wrote:
1. Apple reserves the underscore prefix for their own use, so you could, at
least theoretically, clash with a superclass ivar this way, and
[snip]
3. If I use an ivar prefix that no one else uses (as far as I
On Oct 3, 2011, at 1:31 PM, Kyle Sluder wrote:
1. Apple reserves the underscore prefix for their own use, so you could, at
least theoretically, clash with a superclass ivar this way, and
[snip]
3. If I use an ivar prefix that no one else uses (as far as I know), then I
can make my
On Mon, Oct 3, 2011 at 2:01 PM, Andreas Mayer andr...@harmless.de wrote:
Am 03.10.2011 um 16:14 schrieb John Tsombakos:
audioPlayer = [self getSoundFile:soundfile.wav];
...
in getSoundFile routine:
AVAudioPlayer *snd;
...
snd = [[[AVAudioPlayer alloc] initWithContentsOfURL:url
25 matches
Mail list logo