Thanks Robert and Quincey, that's very helpful!
Op May 29, 2013, om 8:26 AM heeft Quincey Morris
het volgende geschreven:
> On May 28, 2013, at 23:37 , Diederik Meijer | Ten Horses
> wrote:
>
>> 1. With ARC, do we still have to worry about string1 leaking in the
>> following scenario?
>>
On May 28, 2013, at 23:37 , Diederik Meijer | Ten Horses
wrote:
> 1. With ARC, do we still have to worry about string1 leaking in the following
> scenario?
>
> @property (nonatomic, copy) NSString *string1;
> …..
> self.string1 = @"Hello";
> string1 = @"Hello hello";
> string1 = @"Hello hello
On Wednesday, 29. May 2013 at 8:37, Diederik Meijer | Ten Horses wrote:
> May I add two questions to this enlightening thread?
>
> 1. With ARC, do we still have to worry about string1 leaking in the following
> scenario?
>
> @property (nonatomic, copy) NSString *string1;
> …..
No, ARC perf
May I add two questions to this enlightening thread?
1. With ARC, do we still have to worry about string1 leaking in the following
scenario?
@property (nonatomic, copy) NSString *string1;
…..
self.string1 = @"Hello";
string1 = @"Hello hello";
string1 = @"Hello hello hello";
2. How do the stron
On May 28, 2013, at 6:39 AM, Alex Zavatone wrote:
> NSString *myString;
You’ve declared myString as a _mutable_ pointer to an _immutable_ object. If
you had declared it as
NSString* const myString = @“Hi";
then the variable itself would be immutable, and the compiler would give you a
On May 28, 2013, at 7:44 AM, Alex Zavatone wrote:
>
> On May 28, 2013, at 9:46 AM, Steve Mills wrote:
>
>> On May 28, 2013, at 08:39:21, Alex Zavatone wrote:
>>
>>> Though it's clearly defined in the docs when to use NSMubleAnything vs.
>>> NSAnything (insert Array, Dictionary, String, etc f
Alex,
Forget what I said about memory management. It is wrong.
Your confusion probably stems from the fact that the pointer named myString is
allowed to point to any number of string during the execution of your program.
It is the objects that are immutable, not the pointers to them.
Tom Wetmo
Alex,
What your three lines of code do:
> NSString *myString;
Compiler allocates space for a pointer on the run time stack.
> myString = @"Hi";
Compiler creates an NSString object somewhere in the heap with the value @"Hi"
and points the pointer to it.
> myString = @"Hi there";
Compiler cre
On May 28, 2013, at 9:46 AM, Steve Mills wrote:
> On May 28, 2013, at 08:39:21, Alex Zavatone wrote:
>
>> Though it's clearly defined in the docs when to use NSMubleAnything vs.
>> NSAnything (insert Array, Dictionary, String, etc for Anything), there is no
>> compiler warning when you perfor
On May 28, 2013, at 08:39:21, Alex Zavatone wrote:
> Though it's clearly defined in the docs when to use NSMubleAnything vs.
> NSAnything (insert Array, Dictionary, String, etc for Anything), there is no
> compiler warning when you perform a simple action such as allocate a string
> and then r
On May 28, 2013, at 9:50 AM, Roland King wrote:
>
> On 28 May, 2013, at 9:39 PM, Alex Zavatone wrote:
>
>> Though it's clearly defined in the docs when to use NSMubleAnything vs.
>> NSAnything (insert Array, Dictionary, String, etc for Anything), there is no
>> compiler warning when you perf
On 28 May, 2013, at 9:39 PM, Alex Zavatone wrote:
> Though it's clearly defined in the docs when to use NSMubleAnything vs.
> NSAnything (insert Array, Dictionary, String, etc for Anything), there is no
> compiler warning when you perform a simple action such as allocate a string
> and then r
Though it's clearly defined in the docs when to use NSMubleAnything vs.
NSAnything (insert Array, Dictionary, String, etc for Anything), there is no
compiler warning when you perform a simple action such as allocate a string and
then reassign values to it.
With this in mind, what exactly consti
13 matches
Mail list logo