Skip to content

Instantly share code, notes, and snippets.

- (void)methodA
{
id obj1;
id obj2;
id arp;
obj1 = [[Foo alloc] init];
obj2 = [[Foo alloc] init];
[obj1 autorelease];
UIView * viewRoot = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 480, 320)];
viewRoot.backgroundColor = [UIColor clearColor];
UIView * view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
UIView * view2 = [[UIView alloc] initWithFrame:CGRectMake(480-100, 0, 100, 100)];
UIView * view3 = [[UIView alloc] initWithFrame:CGRectMake(0, 320-100, 100, 100)];
UIView * view4 = [[UIView alloc] initWithFrame:CGRectMake(480-100, 320-100, 100, 100)];
[viewRoot addSubvier:view1];
[viewRoot addSubvier:view2];
[viewRoot addSubvier:view3];
[viewRoot addSubvier:view4];
#import <Foundation/Foundation.h>
int main() {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSMutableIndexSet * set = [NSMutableIndexSet indexSet];
[set addIndex:111];
[set addIndex:222];
[set addIndex:333];
[pool release];
return 0;
NSLog(@"%@ %s", [self class], __func__);
#import "RootViewController.h"
@implementation RootViewController
@synthesize scrollView;
@synthesize contentView;
@synthesize views;
@synthesize button1;
@synthesize button2;
- (void)scrollViewDidEndZooming:(UIScrollView*)scrollView withView:(UIView*)view atScale:(float)scale
{
self.scrollView = scale;
}
unionRect.origin.x *= self.scrollScale;
unionRect.origin.y *= self.scrollScale;
unionRect.size.width *= self.scrollScale;
unionRect.size.height *= self.scrollScale;
self.segments = [NSArray arrayWithObjects:self.segment1, self.segment2, self.segment3, self.segment4, self.segment5, nil];
#import <Foundation/Foundation.h>
int main() {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSMutableArray *myMutableArray = [NSMutableArray arrayWithArray:[NSArray array]];
NSLog(@"%@", myMutableArray);
[pool release];
return 0;
#import <Foundation/Foundation.h>
int main() {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSMutableArray *myMutableArray = [NSMutableArray array];
[myMutableArray addObject:[NSString string]];
[myMutableArray addObject:[NSString string]];
[myMutableArray addObject:[NSString string]];
[myMutableArray addObject:[NSString string]];