More Related Content
Similar to Arc of developer part2
Similar to Arc of developer part2 (20)
Arc of developer part2
- 2. CoreFoundation
•C
Quartz
CoreFoundation CGxx
CFxx
CoreAudio
11 11 22
- 5. CF
• CoreFoundation
• Cocoa CoreFoundation
CoreFoundation Cocoa
CFString NSString
11 11 22
- 6. id Void *
id obj = [[NSObject alloc]init];
void *p = obj;
id o = p;
[o release];
ARC
11 11 22
- 7. ARC id -> Void *
•
[super didReceiveMemoryWarning];
id obj = [[NSObject alloc]init];
void *p = (__bridge void *)obj;
id o = (__bridge id) p;
11 11 22
- 8. • __bridge
• __bridge_retained
• __bridge_transfar
11 11 22
- 9. __bridge
•
• __unsafe_unretained
void *p;
{
id obj = [[NSObject alloc]init];
p = (__bridge void *)obj;
}
// p
11 11 22
- 10. __bridge_retained
•
void *p;
{
id obj = [[NSObject alloc]init];
p = (__bridge_retained void *)obj;
}
// p
CFRelease(p);
11 11 22
- 11. __bridge_transfar
•
•
CFStringRef p;
{
id obj = [[NSObject alloc]init];
p = (__bridge_retained CFStringRef)obj;
}
id obj2 = (__bridge_transfer id)p;
11 11 22
- 12. CFBridgingRetain CFBridgingRelease
•
NS_INLINE CF_RETURNS_RETAINED CFTypeRef CFBridgingRetain(id X) {
return (__bridge_retained CFTypeRef)X;
}
NS_INLINE id CFBridgingRelease(CFTypeRef CF_CONSUMED X) {
return (__bridge_transfer id)X;
}
• CFBridgingRetain __bridge_retained
• CGBridgingRelease __bridge_transfer
11 11 22
- 13. CF
• CoreFoundation
• ARC
11 11 22
- 17. • CVS
• Subversion
• Visual Source Safe
• Git
11 11 22
- 18. Git
•
• Linux Linus Torvalds
•
•
• Xcode4
11 11 22
- 19. •
• CVS
•
•
•
•
11 11 22
- 22. Git
•
•
• Sync
• Sync
•
11 11 22
- 25. A B
! touchView = [[TouchDetectView alloc]initWithFrame:mapView.frame];
! [self.view insertSubview:touchView atIndex:0];
! touchView.delegate = self;
! touchView.viewTouched = mapView;
! mapView.frame = CGRectMake(0, 0, mapView.frame.size.width, mapView.frame.size.height);
! [touchView addSubview:mapView];
! mapView.showsUserLocation = NO;
11 11 22
- 26. A B
! touchView = [[TouchDetectView alloc]initWithFrame:mapView.frame];
! [self.view insertSubview:touchView atIndex:0];
! touchView.delegate = self;
! touchView.viewTouched = mapView;
! mapView.frame = CGRectMake(0, 0, mapView.frame.size.width, mapView.frame.size.height);
! [touchView addSubview:mapView];
! mapView.showsUserLocation = NO;
11 11 22
- 27. A B
! touchView = [[TouchDetectView alloc]initWithFrame:mapView.frame];
! [self.view insertSubview:touchView atIndex:0];
! touchView.delegate = self;
! touchView.viewTouched = mapView;
! mapView.frame = CGRectMake(0, 0, mapView.frame.size.width, mapView.frame.size.he
! [touchView addSubview:mapView];
! mapView.showsUserLocation = NO;
11 11 22
- 28. A B
! touchView = [[TouchDetectView alloc]initWithFrame:mapView.frame];
! [self.view insertSubview:touchView atIndex:0];
! touchView.delegate = self;
! touchView.viewTouched = mapView;
! mapView.frame = CGRectMake(0, 0, mapView.frame.size.width, mapView.frame.size.height);
! [touchView addSubview:mapView];
! mapView.showsUserLocation = NO;
11 11 22