emailconfirmed, nsInternRO, nsInternRW, Administrators
3,356
edits
Line 46: | Line 46: | ||
=== UIViews === | === UIViews === | ||
* Gewöhnliche Komponenten, die in Interface Builder arrangiert werden | * Gewöhnliche Komponenten, die in Interface Builder arrangiert werden | ||
* z.B. UITableView, UIButtons, UITextField, UISlider, UIPickerView ... | * z.B. UITableView, UIWebView, UIButtons, UITextField, UISlider, UIPickerView ... | ||
Beispiel: | Beispiel (UITableView subclass): | ||
<source lang="objc"> | <source lang="objc"> | ||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | ||
// | // In order to show a new view, we'll create a new view controller instance | ||
// and push it onto the views stack of the Navigation Controller | |||
RecipeDetailViewController *detailViewController = [[RecipeDetailViewController alloc] initWithStyle:UITableViewStyleGrouped]; | RecipeDetailViewController *detailViewController = [[RecipeDetailViewController alloc] initWithStyle:UITableViewStyleGrouped]; | ||
[self.navigationController pushViewController:detailViewController animated:animated]; | [self.navigationController pushViewController:detailViewController animated:animated]; | ||
[detailViewController release]; | [detailViewController release]; | ||
Line 67: | Line 67: | ||
* [http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html iPhone Dev Center: Quartz 2D Programming Guide] | * [http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html iPhone Dev Center: Quartz 2D Programming Guide] | ||
Beispiel: | Beispiel (UIView sublcass): | ||
<source lang="objc"> | <source lang="objc"> | ||
- (void)drawRect:(NSRect)rect { | - (void)drawRect:(NSRect)rect { | ||
Line 89: | Line 88: | ||
* [http://developer.apple.com/iphone/library/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Introduction/Introduction.html iPhone Dev Center: OpenGL ES Programming Guide] | * [http://developer.apple.com/iphone/library/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Introduction/Introduction.html iPhone Dev Center: OpenGL ES Programming Guide] | ||
Beispiel: | Beispiel (UIView subclass w. custom timer): | ||
<source lang="objc"> | <source lang="objc"> | ||
- (void) render { | - (void) render { | ||
Line 117: | Line 115: | ||
glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer); | glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer); | ||
[context presentRenderbuffer:GL_RENDERBUFFER_OES]; | [context presentRenderbuffer:GL_RENDERBUFFER_OES]; | ||
} | |||
-(void)applicationDidFinishLaunching:(UIApplication*)application { | |||
// (...) | |||
animationTimer = [NSTimer scheduledTimerWithTimeInterval:(NSTimeInterval)((1.0 / 60.0) * animationFrameInterval) target:self selector:@selector(render:) userInfo:nil repeats:TRUE]; | |||
} | } | ||
</source> | </source> |