FROM : Shawn Erickson
DATE : Sun Apr 10 18:02:40 2005
On Apr 10, 2005, at 4:43 AM, John James wrote:
> I am still in my 1st year of learning so bear with me.
>
> I finally got this part of my program working, but I am not sure why.
> I have a method which creates a small report in a NSString* which is
> later
> shown in a window.
>
> I do something like this:
>
> NSString* rpt = @"#session( \r";
>
> and then multiple lines of the sort:
>
> rpt = [rpt stringByAppendingString : objectString];
> where objectString is built up in a similar way to make an report
> record.
>
> finally I return rpt.
Others have pointed you to the docs on memory management in Cocoa...
I want to point out that the above may be better done by using an
NSMutableString if you are building a string in steps and parts.
-Shawn
DATE : Sun Apr 10 18:02:40 2005
On Apr 10, 2005, at 4:43 AM, John James wrote:
> I am still in my 1st year of learning so bear with me.
>
> I finally got this part of my program working, but I am not sure why.
> I have a method which creates a small report in a NSString* which is
> later
> shown in a window.
>
> I do something like this:
>
> NSString* rpt = @"#session( \r";
>
> and then multiple lines of the sort:
>
> rpt = [rpt stringByAppendingString : objectString];
> where objectString is built up in a similar way to make an report
> record.
>
> finally I return rpt.
Others have pointed you to the docs on memory management in Cocoa...
I want to point out that the above may be better done by using an
NSMutableString if you are building a string in steps and parts.
-Shawn
| Related mails | Author | Date |
|---|---|---|
| John James | Apr 10, 13:43 | |
| Matteo Ceruti | Apr 10, 13:58 | |
| Will Mason | Apr 10, 14:01 | |
| Finlay Dobbie | Apr 10, 15:00 | |
| Shawn Erickson | Apr 10, 18:02 | |
| Finlay Dobbie | Apr 10, 18:06 |






Cocoa mail archive

