1 | #import <Foundation/Foundation.h> |
2 | |
3 | @interface A : NSObject |
4 | { |
5 | int m_a; |
6 | } |
7 | -(id)init; |
8 | -(void)accessMember:(int)a; |
9 | +(void)accessStaticMember:(int)a; |
10 | @end |
11 | |
12 | static int s_a = 5; |
13 | |
14 | @implementation A |
15 | -(id)init |
16 | { |
17 | self = [super init]; |
18 | |
19 | if (self) |
20 | m_a = 2; |
21 | |
22 | return self; |
23 | } |
24 | |
25 | -(void)accessMember:(int)a |
26 | { |
27 | m_a = a; // breakpoint 1 |
28 | } |
29 | |
30 | +(void)accessStaticMember:(int)a |
31 | { |
32 | s_a = a; // breakpoint 2 |
33 | } |
34 | @end |
35 | |
36 | int main() |
37 | { |
38 | NSAutoreleasePool *pool = [NSAutoreleasePool alloc]; |
39 | A *my_a = [[A alloc] init]; |
40 | |
41 | [my_a accessMember:3]; |
42 | [A accessStaticMember:5]; |
43 | |
44 | [pool release]; |
45 | } |
46 | |