March 2014 update
This commit is contained in:
parent
09687c4926
commit
a25938f123
1846 changed files with 21876 additions and 5203 deletions
|
|
@ -1,5 +1,4 @@
|
|||
@interface T : NSObject
|
||||
{ }
|
||||
- (void)identify;
|
||||
@end
|
||||
|
||||
|
|
@ -17,7 +16,6 @@
|
|||
@end
|
||||
|
||||
@interface S : T
|
||||
{ }
|
||||
@end
|
||||
|
||||
@implementation S
|
||||
|
|
@ -29,11 +27,12 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
T *original = [[S alloc] init];
|
||||
T *another = [original copy];
|
||||
[another identify]; // logs "I am an S"
|
||||
@autoreleasepool {
|
||||
|
||||
[another release]; // like "alloc", the object returned by "copy" is "owned" by the caller, so we are responsible for releasing it
|
||||
[original release];
|
||||
T *original = [[S alloc] init];
|
||||
T *another = [original copy];
|
||||
[another identify]; // logs "I am an S"
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue