| Computers Forum Index » Computer Languages (Objective-C) » Need help in understanding objective c code... |
|
Page 1 of 1 |
|
| Author |
Message |
| silverburgh... |
Posted: Thu May 28, 2009 4:25 am |
|
|
|
Guest
|
I need some help in understanding the following code:
1. What is the meaning of ' at (no spam) ' in at (no spam) "Reload"
button = MakeTestButton(&button_rect, at (no spam) "Reload", content);
[button setTarget:web_view];
[button setAction: at (no spam) selector(reload:)];
2. Where I can find the definition of " at (no spam) selector(reload:)"? |
|
|
| Back to top |
|
|
|
| Gregory Weston... |
Posted: Fri May 29, 2009 4:37 am |
|
|
|
Guest
|
In article
<69fbd3d6-f4b9-4db6-9bd7-de150e98065a at (no spam) p6g2000pre.googlegroups.com>,
silverburgh <silverburgh.meryl at (no spam) gmail.com> wrote:
Quote: I need some help in understanding the following code:
1. What is the meaning of ' at (no spam) ' in at (no spam) "Reload"
It means that this is an NSString* instead of a char*.
Quote: button = MakeTestButton(&button_rect, at (no spam) "Reload", content);
[button setTarget:web_view];
[button setAction: at (no spam) selector(reload:)];
2. Where I can find the definition of " at (no spam) selector(reload:)"?
Depends what you mean by that. The answer to my best guess at your
meaning is that at (no spam) selector returns a SEL object for the method name
provided as an argument. The result of the code that you show is that
when the button is clicked it will do this:
[web_view reload:button];
--
I saw a truck today that had "AAA Batteries / Delivered and Installed" on the
side. My first thought was: That's a really weird business model. How many
inept people have urgent need of skinny little battery cells? |
|
|
| Back to top |
|
|
|
| Preston... |
Posted: Mon Jul 06, 2009 2:23 am |
|
|
|
Guest
|
On 2009-05-27 22:25:13 -0600, silverburgh <silverburgh.meryl at (no spam) gmail.com> said:
Quote: I need some help in understanding the following code:
1. What is the meaning of ' at (no spam) ' in at (no spam) "Reload"
The at (no spam) prefix is an Objective-C extension that creates a literal
NSString which will exist for the duration of your application. |
|
|
| Back to top |
|
|
|
|