iphone sdk örnekleri

Günlüğü Görüntülemek(Logging)
Xcode’da Run>Console ve NsLog deyimlerini görmek için.
NSLog(@”log: %@ “, myString);
NSLog(@”log: %f “, myFloat);
NSLog(@”log: %i “, myInt);


UI Builder’i kullanmadan resimleri görüntülemek :

CGRect myImageRect = CGRectMake(0.0f, 0.0f, 320.0f, 109.0f);

UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];

[myImage setImage:[UIImage imageNamed:@”myImage.png”]];

myImage.opaque = YES; // explicitly opaque for performance

[self.view addSubview:myImage]; [myImage release];

Basit bir Web View
UI ile basit bir web görüntüsü almak için :
CGRect webFrame = CGRectMake(0.0, 0.0, 320.0, 460.0);
UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];
[webView setBackgroundColor:[UIColor whiteColor]];
NSString *urlAddress = @”http://www.google.com”;
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self addSubview:webView]; [webView release];

This entry was posted in Objective-C and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *