- Registriert
- 15.05.11
- Beiträge
- 51
Hallo zusammen,
*immer noch Anfänger*
ich habe im Moment ein Problem damit, mehrere Bilder hintereinander zum zeigen, bevor die eigentliche App startet.
Ich habe mir ein Tutorial angeschaut (um genau zu sein das hier: http://www.icodeblog.com/2009/03/18/iphone-game-programming-tutorial-part-3-splash-screen/)
Es funktioniert auch, nur wenn die App fertig geladen hat, kann ich weder eine Tabellenzeile mehr anklicken, noch meine ToolBar.
Vielleicht habt ihr ja eine ganz andere Lösung, die ihr mir zur Verfügung stellt, oder jemand kennt noch ein anderes Tutorial...
In der AppDelegate seht das:
(.h-Datei)
und .m-Datei:
Wenn ich die Zeile wo HIER!!! steht (am Anfang der.m-Datei) nicht kommentiere, sondern als Code mit einbeziehe, funktioniert zwar wieder die Tabelle und die ToolBar ist wieder an der richtigen Stelle und lässt sich anklicken, aber es kommt wieder nur der alte Ladebildschirm und der zweite fehlt...
Ich hoffe mir kann jemand helfen,
danke
Hier noch die beiden Klassen aus dem Tut:
Ich hoffe ich habe in dem ganzen Wirrwarr nicht irgendetwas vergessen. Wenn Informationen fehlen, kurz Bescheid sagen...
*immer noch Anfänger*
ich habe im Moment ein Problem damit, mehrere Bilder hintereinander zum zeigen, bevor die eigentliche App startet.
Ich habe mir ein Tutorial angeschaut (um genau zu sein das hier: http://www.icodeblog.com/2009/03/18/iphone-game-programming-tutorial-part-3-splash-screen/)
Es funktioniert auch, nur wenn die App fertig geladen hat, kann ich weder eine Tabellenzeile mehr anklicken, noch meine ToolBar.
Vielleicht habt ihr ja eine ganz andere Lösung, die ihr mir zur Verfügung stellt, oder jemand kennt noch ein anderes Tutorial...
In der AppDelegate seht das:
(.h-Datei)
Code:
[COLOR=#CE2E24][COLOR=#77482d]#import [/COLOR]"RootViewController.h"[/COLOR][COLOR=#ce2e24][COLOR=#77482d]#import [/COLOR]"SplashViewController.h"[/COLOR]
[COLOR=#b731a1]@interface[/COLOR] TableViewPushAppDelegate : [COLOR=#6f41a8]NSObject[/COLOR] <[COLOR=#6f41a8]UIApplicationDelegate[/COLOR]> {
[COLOR=#6f41a8]UIWindow[/COLOR] *window;
[COLOR=#6f41a8]UINavigationController[/COLOR] *navigationController;
[COLOR=#518187]SplashViewController[/COLOR] *viewcontroller;
[COLOR=#b731a1]@private[/COLOR]
[COLOR=#6f41a8]NSManagedObjectContext[/COLOR] *managedObjectContext_;
[COLOR=#6f41a8]NSManagedObjectModel[/COLOR] *managedObjectModel_;
[COLOR=#6f41a8]NSPersistentStoreCoordinator[/COLOR] *persistentStoreCoordinator_;
}
[COLOR=#b731a1]@property[COLOR=#000000] ([/COLOR]nonatomic[COLOR=#000000], [/COLOR]retain[COLOR=#000000]) [/COLOR]IBOutlet[COLOR=#6f41a8]UIWindow[/COLOR][COLOR=#000000] *window;[/COLOR][/COLOR]
[COLOR=#b731a1]@property[COLOR=#000000] ([/COLOR]nonatomic[COLOR=#000000], [/COLOR]retain[COLOR=#000000]) [/COLOR]IBOutlet[COLOR=#6f41a8]UINavigationController[/COLOR][COLOR=#000000] *navigationController;[/COLOR][/COLOR]
[COLOR=#b731a1]@property[COLOR=#000000] ([/COLOR]nonatomic[COLOR=#000000], [/COLOR]retain[COLOR=#000000], [/COLOR]readonly[COLOR=#000000]) [/COLOR][COLOR=#6f41a8]NSManagedObjectContext[/COLOR][COLOR=#000000] *managedObjectContext;[/COLOR][/COLOR]
[COLOR=#b731a1]@property[COLOR=#000000] ([/COLOR]nonatomic[COLOR=#000000], [/COLOR]retain[COLOR=#000000], [/COLOR]readonly[COLOR=#000000]) [/COLOR][COLOR=#6f41a8]NSManagedObjectModel[/COLOR][COLOR=#000000] *managedObjectModel;[/COLOR][/COLOR]
[COLOR=#b731a1]@property[/COLOR] ([COLOR=#b731a1]nonatomic[/COLOR], [COLOR=#b731a1]retain[/COLOR], [COLOR=#b731a1]readonly[/COLOR]) [COLOR=#6f41a8]NSPersistentStoreCoordinator[/COLOR] *persistentStoreCoordinator;
[COLOR=#b731a1]@property[COLOR=#000000] ([/COLOR]nonatomic[COLOR=#000000],[/COLOR]retain[COLOR=#000000]) [/COLOR]IBOutlet[COLOR=#518187]SplashViewController[/COLOR][COLOR=#000000] *viewController;[/COLOR][/COLOR]
- ([COLOR=#6f41a8]NSURL[/COLOR] *)applicationDocumentsDirectory;
- ([COLOR=#b731a1]void[/COLOR])saveContext;
[COLOR=#B731A1]@end[/COLOR]
und .m-Datei:
Code:
[COLOR=#CE2E24][COLOR=#77482d]#import [/COLOR]"TableViewPushAppDelegate.h"[/COLOR][COLOR=#ce2e24][COLOR=#77482d]#import [/COLOR]"RootViewController.h"[/COLOR]
[COLOR=#b731a1]@implementation[/COLOR] TableViewPushAppDelegate
[COLOR=#b731a1]@synthesize[COLOR=#000000] window;[/COLOR][/COLOR]
[COLOR=#b731a1]@synthesize[/COLOR] navigationController;
[COLOR=#b731a1]@synthesize[/COLOR] viewController;
[COLOR=#77482d]#pragma mark -[/COLOR]
[COLOR=#77482d]#pragma mark Application lifecycle[/COLOR]
- ([COLOR=#b731a1]void[/COLOR])awakeFromNib {
RootViewController *[COLOR=#518187]rootViewController[/COLOR] = ([COLOR=#518187]RootViewController[/COLOR] *)[[COLOR=#3c2280]navigationController[/COLOR] topViewController];
rootViewController.managedObjectContext = [COLOR=#b731a1]self[/COLOR].managedObjectContext;
}
- ([COLOR=#b731a1]void[/COLOR])applicationDidFinishLaunching:(UIApplication *)application {
viewController = [[[COLOR=#3c2280]SplashViewController[/COLOR] [COLOR=#3c2280]alloc[/COLOR]] init];
[COLOR=#098310]// Override point for customization after app launch [/COLOR]
[window addSubview:[viewController view]];
sleep ([COLOR=#2633d5]3.2[/COLOR]);
[[COLOR=#b731a1]self[/COLOR].window makeKeyAndVisible];
[COLOR=#098310]// [self.window addSubview:navigationController.view]; //HIER!!![/COLOR]
[COLOR=#098310]//[window makeKeyAndVisible];[/COLOR]
}
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310]- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [/COLOR]
[COLOR=#098310] viewController = [[SplashViewController alloc] init];[/COLOR]
[COLOR=#098310] // Override point for customization after app launch [/COLOR]
[COLOR=#098310] [self.window addSubview:[viewController view]];[/COLOR]
[COLOR=#098310] sleep(3.2);[/COLOR]
[COLOR=#098310] // create tab bar controller and array to hold the view controllers[/COLOR]
[COLOR=#098310] // Add the navigation controller's view to the window and display.[/COLOR]
[COLOR=#098310] [self.window addSubview:navigationController.view];[/COLOR]
[COLOR=#098310] [self.window makeKeyAndVisible];[/COLOR]
[COLOR=#098310] return YES;[/COLOR]
[COLOR=#098310]}[/COLOR]
[COLOR=#098310] */[/COLOR]
- ([COLOR=#b731a1]void[/COLOR])applicationWillResignActive:(UIApplication *)application {
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310] Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.[/COLOR]
[COLOR=#098310] Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.[/COLOR]
[COLOR=#098310] */[/COLOR]
}
- ([COLOR=#b731a1]void[/COLOR])applicationDidEnterBackground:(UIApplication *)application {
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310] Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. [/COLOR]
[COLOR=#098310] If your application supports background execution, called instead of applicationWillTerminate: when the user quits.[/COLOR]
[COLOR=#098310] */[/COLOR]
[[COLOR=#b731a1]self[/COLOR] saveContext];
}
- ([COLOR=#b731a1]void[/COLOR])applicationWillEnterForeground:(UIApplication *)application {
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310] Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.[/COLOR]
[COLOR=#098310] */[/COLOR]
}
- ([COLOR=#b731a1]void[/COLOR])applicationDidBecomeActive:(UIApplication *)application {
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310] Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.[/COLOR]
[COLOR=#098310] */[/COLOR]
}
[COLOR=#098310]/**[/COLOR]
[COLOR=#098310] applicationWillTerminate: saves changes in the application's managed object context before the application terminates.[/COLOR]
[COLOR=#098310] */[/COLOR]
- ([COLOR=#b731a1]void[/COLOR])applicationWillTerminate:(UIApplication *)application {
[[COLOR=#b731a1]self[/COLOR] saveContext];
}
- ([COLOR=#b731a1]void[/COLOR])saveContext {
NSError *error = [COLOR=#b731a1]nil[/COLOR];
NSManagedObjectContext *[COLOR=#3c2280]managedObjectContext[/COLOR] = [COLOR=#b731a1]self[/COLOR].managedObjectContext;
[COLOR=#b731a1]if[/COLOR] (managedObjectContext != [COLOR=#b731a1]nil[/COLOR]) {
[COLOR=#b731a1]if[/COLOR] ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) {
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310] Replace this implementation with code to handle the error appropriately.[/COLOR]
[COLOR=#098310] abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button.[/COLOR]
[COLOR=#098310] */[/COLOR]
NSLog([COLOR=#ce2e24]@"Unresolved error %@, %@"[/COLOR], error, [error userInfo]);
abort();
}
}
}
[COLOR=#77482d]#pragma mark -[/COLOR]
[COLOR=#77482d]#pragma mark Core Data stack[/COLOR]
[COLOR=#098310]/**[/COLOR]
[COLOR=#098310] Returns the managed object context for the application.[/COLOR]
[COLOR=#098310] If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application.[/COLOR]
[COLOR=#098310] */[/COLOR]
- (NSManagedObjectContext *)managedObjectContext {
[COLOR=#b731a1]if[/COLOR] (managedObjectContext_ != [COLOR=#b731a1]nil[/COLOR]) {
[COLOR=#77482d][COLOR=#b731a1]return[/COLOR]managedObjectContext_[COLOR=#000000];[/COLOR][/COLOR]
}
NSPersistentStoreCoordinator *coordinator = [[COLOR=#b731a1]self[/COLOR] persistentStoreCoordinator];
[COLOR=#b731a1]if[/COLOR] ([COLOR=#518187]coordinator[/COLOR] != [COLOR=#b731a1]nil[/COLOR]) {
managedObjectContext_ = [[NSManagedObjectContext alloc] init];
[managedObjectContext_ setPersistentStoreCoordinator:coordinator];
}
[COLOR=#b731a1]return[/COLOR] managedObjectContext_;
}
[COLOR=#098310]/**[/COLOR]
[COLOR=#098310] Returns the managed object model for the application.[/COLOR]
[COLOR=#098310] If the model doesn't already exist, it is created from the application's model.[/COLOR]
[COLOR=#098310] */[/COLOR]
- ([COLOR=#518187]NSManagedObjectModel[/COLOR] *)managedObjectModel {
[COLOR=#6f41a8][COLOR=#b731a1]if[/COLOR][COLOR=#000000] ([/COLOR]managedObjectModel_[COLOR=#000000] != [/COLOR][COLOR=#b731a1]nil[/COLOR][COLOR=#000000]) {[/COLOR][/COLOR]
[COLOR=#6f41a8][COLOR=#b731a1]return[/COLOR]managedObjectModel_[COLOR=#000000];[/COLOR][/COLOR]
}
[COLOR=#518187]NSString[/COLOR] *[COLOR=#3c2280]modelPath[/COLOR] = [[NSBundle mainBundle] pathForResource:[COLOR=#ce2e24]@"TableViewPush"[/COLOR] ofType:[COLOR=#ce2e24]@"momd"[/COLOR]];
NSURL *modelURL = [NSURL fileURLWithPath:modelPath];
managedObjectModel_ = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
[COLOR=#b731a1]return[/COLOR] managedObjectModel_;
}
[COLOR=#098310]/**[/COLOR]
[COLOR=#098310] Returns the persistent store coordinator for the application.[/COLOR]
[COLOR=#098310] If the coordinator doesn't already exist, it is created and the application's store added to it.[/COLOR]
[COLOR=#098310] */[/COLOR]
- ([COLOR=#518187]NSPersistentStoreCoordinator[/COLOR] *)persistentStoreCoordinator {
[COLOR=#33595d][COLOR=#b731a1]if[/COLOR][COLOR=#000000] ([/COLOR]persistentStoreCoordinator_[COLOR=#000000] != [/COLOR][COLOR=#b731a1]nil[/COLOR][COLOR=#000000]) {[/COLOR][/COLOR]
[COLOR=#b731a1]return[/COLOR] persistentStoreCoordinator_;
}
[COLOR=#3c2280][COLOR=#000000] NSURL *storeURL = [[[/COLOR][COLOR=#b731a1]self[/COLOR]applicationDocumentsDirectory[COLOR=#000000]] [/COLOR]URLByAppendingPathComponent[COLOR=#000000]:[/COLOR][COLOR=#ce2e24]@"TableViewPush.sqlite"[/COLOR][COLOR=#000000]];[/COLOR][/COLOR]
[COLOR=#3c2280]NSError[/COLOR] *error = [COLOR=#b731a1]nil[/COLOR];
persistentStoreCoordinator_ = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[[COLOR=#b731a1]self[/COLOR] managedObjectModel]];
[COLOR=#b731a1]if[/COLOR] (![persistentStoreCoordinator_ addPersistentStoreWithType:NSSQLiteStoreType configuration:[COLOR=#b731a1]nil[/COLOR] URL:storeURL options:[COLOR=#b731a1]nil[/COLOR] error:&error]) {
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310] Replace this implementation with code to handle the error appropriately.[/COLOR]
[COLOR=#098310] abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button.[/COLOR]
[COLOR=#098310] Typical reasons for an error here include:[/COLOR]
[COLOR=#098310] * The persistent store is not accessible;[/COLOR]
[COLOR=#098310] * The schema for the persistent store is incompatible with current managed object model.[/COLOR]
[COLOR=#098310] Check the error message to determine what the actual problem was.[/COLOR]
[COLOR=#098310] If the persistent store is not accessible, there is typically something wrong with the file path. Often, a file URL is pointing into the application's resources directory instead of a writeable directory.[/COLOR]
[COLOR=#098310] If you encounter schema incompatibility errors during development, you can reduce their frequency by:[/COLOR]
[COLOR=#098310] * Simply deleting the existing store:[/COLOR]
[COLOR=#098310] [[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil][/COLOR]
[COLOR=#098310] * Performing automatic lightweight migration by passing the following dictionary as the options parameter: [/COLOR]
[COLOR=#098310] [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES],NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];[/COLOR]
[COLOR=#098310] Lightweight migration will only work for a limited set of schema changes; consult "Core Data Model Versioning and Data Migration Programming Guide" for details.[/COLOR]
[COLOR=#098310] */[/COLOR]
[COLOR=#518187]NSLog[/COLOR]([COLOR=#ce2e24]@"Unresolved error %@, %@"[/COLOR], error, [error userInfo]);
abort();
}
[COLOR=#b731a1]return[/COLOR] persistentStoreCoordinator_;
}
[COLOR=#77482d]#pragma mark -[/COLOR]
[COLOR=#77482d]#pragma mark Application's Documents directory[/COLOR]
[COLOR=#098310]/**[/COLOR]
[COLOR=#098310] Returns the URL to the application's Documents directory.[/COLOR]
[COLOR=#098310] */[/COLOR]
[COLOR=#3c2280][COLOR=#000000]- (NSURL *)[/COLOR]applicationDocumentsDirectory[COLOR=#000000] {[/COLOR][/COLOR]
[COLOR=#b731a1]return[/COLOR] [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}
[COLOR=#77482d]#pragma mark -[/COLOR]
[COLOR=#77482d]#pragma mark Memory management[/COLOR]
- ([COLOR=#b731a1]void[/COLOR])applicationDidReceiveMemoryWarning:(UIApplication *)application {
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310] Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.[/COLOR]
[COLOR=#098310] */[/COLOR]
}
- ([COLOR=#b731a1]void[/COLOR])dealloc {
[COLOR=#3c2280][COLOR=#000000] [[/COLOR]managedObjectContext_[COLOR=#000000] release];[/COLOR][/COLOR]
[COLOR=#3c2280][COLOR=#000000] [[/COLOR]managedObjectModel_[COLOR=#000000] release];[/COLOR][/COLOR]
[COLOR=#3c2280][COLOR=#000000] [[/COLOR]persistentStoreCoordinator_[COLOR=#000000] release];[/COLOR][/COLOR]
[navigationController release];
[window release];
[viewController release];
[[COLOR=#b731a1]super[/COLOR] dealloc];
}
[COLOR=#B731A1]@end[/COLOR]
Wenn ich die Zeile wo HIER!!! steht (am Anfang der.m-Datei) nicht kommentiere, sondern als Code mit einbeziehe, funktioniert zwar wieder die Tabelle und die ToolBar ist wieder an der richtigen Stelle und lässt sich anklicken, aber es kommt wieder nur der alte Ladebildschirm und der zweite fehlt...
Ich hoffe mir kann jemand helfen,
danke
Hier noch die beiden Klassen aus dem Tut:
Code:
[COLOR=#CE2E24][COLOR=#77482d]#import [/COLOR]<UIKit/UIKit.h>[/COLOR][COLOR=#ce2e24][COLOR=#77482d]#import [/COLOR]"RootViewController.h"[/COLOR]
[COLOR=#b731a1]@interface[/COLOR] SplashViewController : [COLOR=#6f41a8]UIViewController[/COLOR] {
[COLOR=#6f41a8]NSTimer[/COLOR] *timer;
[COLOR=#6f41a8]UIImageView[/COLOR] *splashImageView;
[COLOR=#518187]RootViewController[/COLOR] *viewController;
}
[COLOR=#b731a1]@property[COLOR=#000000]([/COLOR]nonatomic[COLOR=#000000],[/COLOR]retain[COLOR=#000000]) [/COLOR][COLOR=#6f41a8]NSTimer[/COLOR][COLOR=#000000] *timer;[/COLOR][/COLOR]
[COLOR=#b731a1]@property[COLOR=#000000]([/COLOR]nonatomic[COLOR=#000000],[/COLOR]retain[COLOR=#000000]) [/COLOR][COLOR=#6f41a8]UIImageView[/COLOR][COLOR=#000000] *splashImageView;[/COLOR][/COLOR]
[COLOR=#b731a1]@property[COLOR=#000000]([/COLOR]nonatomic[COLOR=#000000],[/COLOR]retain[COLOR=#000000]) [/COLOR][COLOR=#518187]RootViewController[/COLOR][COLOR=#000000] *viewController;[/COLOR][/COLOR]
[COLOR=#b731a1]@end[/COLOR]
Code:
[COLOR=#CE2E24][COLOR=#77482d]#import [/COLOR]"SplashViewController.h"[/COLOR]
[COLOR=#b731a1]@implementation[/COLOR] SplashViewController
[COLOR=#b731a1]@synthesize[/COLOR] timer,splashImageView,viewController;
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310]// The designated initializer. Override to perform setup that is required before the view is loaded.[/COLOR]
[COLOR=#098310]- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {[/COLOR]
[COLOR=#098310] if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {[/COLOR]
[COLOR=#098310] // Custom initialization[/COLOR]
[COLOR=#098310] }[/COLOR]
[COLOR=#098310] return self;[/COLOR]
[COLOR=#098310]}[/COLOR]
[COLOR=#098310]*/[/COLOR]
[COLOR=#098310]// Implement loadView to create a view hierarchy programmatically, without using a nib.[/COLOR]
- ([COLOR=#b731a1]void[/COLOR])loadView {
[COLOR=#098310][COLOR=#000000] [/COLOR]// Init the view[/COLOR]
[COLOR=#3c2280][COLOR=#000000] [/COLOR][COLOR=#6f41a8]CGRect[/COLOR][COLOR=#000000] appFrame = [[[/COLOR][COLOR=#6f41a8]UIScreen[/COLOR]mainScreen[COLOR=#000000]] [/COLOR]applicationFrame[COLOR=#000000]];[/COLOR][/COLOR]
[COLOR=#6f41a8]UIView[/COLOR] *view = [[[COLOR=#6f41a8]UIView[/COLOR] [COLOR=#3c2280]alloc[/COLOR]] [COLOR=#3c2280]initWithFrame[/COLOR]:appFrame];
[COLOR=#3c2280][COLOR=#000000] view.[/COLOR][COLOR=#6f41a8]autoresizingMask[/COLOR][COLOR=#000000] = [/COLOR]UIViewAutoresizingFlexibleHeight[COLOR=#000000]|[/COLOR]UIViewAutoresizingFlexibleWidth[COLOR=#000000];[/COLOR][/COLOR]
[COLOR=#b731a1]self[/COLOR].[COLOR=#6f41a8]view[/COLOR] = view;
[view [COLOR=#3c2280]release[/COLOR]];
[COLOR=#3c2280][COLOR=#000000] [/COLOR][COLOR=#518187]splashImageView[/COLOR][COLOR=#000000] = [[[/COLOR][COLOR=#6f41a8]UIImageView[/COLOR]alloc[COLOR=#000000]] [/COLOR]initWithImage[COLOR=#000000]:[[/COLOR][COLOR=#6f41a8]UIImage[/COLOR]imageNamed[COLOR=#000000]:[/COLOR][COLOR=#ce2e24]@"Bild.png"[/COLOR][COLOR=#000000]]];[/COLOR][/COLOR]
[COLOR=#518187][COLOR=#000000] [/COLOR]splashImageView[COLOR=#000000].[/COLOR][COLOR=#6f41a8]frame[/COLOR][COLOR=#000000] = [/COLOR][COLOR=#3c2280]CGRectMake[/COLOR][COLOR=#000000]([/COLOR][COLOR=#2633d5]0[/COLOR][COLOR=#000000], [/COLOR][COLOR=#2633d5]0[/COLOR][COLOR=#000000], [/COLOR][COLOR=#2633d5]320[/COLOR][COLOR=#000000], [/COLOR][COLOR=#2633d5]480[/COLOR][COLOR=#000000]);[/COLOR][/COLOR]
[COLOR=#518187][COLOR=#000000] [[/COLOR][COLOR=#b731a1]self[/COLOR][COLOR=#000000].[/COLOR][COLOR=#6f41a8]view[/COLOR][COLOR=#3c2280]addSubview[/COLOR][COLOR=#000000]:[/COLOR]splashImageView[COLOR=#000000]];[/COLOR][/COLOR]
[COLOR=#3c2280][COLOR=#000000] [/COLOR][COLOR=#518187]viewController[/COLOR][COLOR=#000000] = [[[/COLOR][COLOR=#518187]RootViewController[/COLOR]alloc[COLOR=#000000]] [/COLOR]initWithNibName[COLOR=#000000]:[/COLOR][COLOR=#ce2e24]@"RootViewController"[/COLOR]bundle[COLOR=#000000]:[[/COLOR][COLOR=#6f41a8]NSBundle[/COLOR]mainBundle[COLOR=#000000]]];[/COLOR][/COLOR]
[COLOR=#518187][COLOR=#000000] [/COLOR]viewController[COLOR=#000000].[/COLOR][COLOR=#6f41a8]view[/COLOR][COLOR=#000000].[/COLOR][COLOR=#6f41a8]alpha[/COLOR][COLOR=#000000] = [/COLOR][COLOR=#2633d5]0.0[/COLOR][COLOR=#000000];[/COLOR][/COLOR]
[COLOR=#518187][COLOR=#000000] [[/COLOR][COLOR=#b731a1]self[/COLOR][COLOR=#000000].[/COLOR][COLOR=#6f41a8]view[/COLOR][COLOR=#3c2280]addSubview[/COLOR][COLOR=#000000]:[/COLOR]viewController[COLOR=#000000].[/COLOR][COLOR=#6f41a8]view[/COLOR][COLOR=#000000]];[/COLOR][/COLOR]
[COLOR=#3c2280][COLOR=#000000] [/COLOR][COLOR=#518187]timer[/COLOR][COLOR=#000000] = [[/COLOR][COLOR=#6f41a8]NSTimer[/COLOR]scheduledTimerWithTimeInterval[COLOR=#000000]:[/COLOR][COLOR=#2633d5]6.0[/COLOR]target[COLOR=#000000]:[/COLOR][COLOR=#b731a1]self[/COLOR]selector[COLOR=#000000]:[/COLOR][COLOR=#b731a1]@selector[/COLOR][COLOR=#000000](fadeScreen) [/COLOR]userInfo[COLOR=#000000]:[/COLOR][COLOR=#b731a1]nil[/COLOR]repeats[COLOR=#000000]:[/COLOR][COLOR=#b731a1]NO[/COLOR][COLOR=#000000]];[/COLOR][/COLOR]
}
-([COLOR=#b731a1]void[/COLOR]) onTimer{
[COLOR=#ce2e24][COLOR=#000000] [/COLOR][COLOR=#3c2280]NSLog[/COLOR][COLOR=#000000]([/COLOR]@"LOAD"[COLOR=#000000]);[/COLOR][/COLOR]
}
- ([COLOR=#b731a1]void[/COLOR])fadeScreen
{
[COLOR=#098310][COLOR=#000000] [[/COLOR][COLOR=#6f41a8]UIView[/COLOR][COLOR=#3c2280]beginAnimations[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#b731a1]nil[/COLOR][COLOR=#3c2280]context[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#b731a1]nil[/COLOR][COLOR=#000000]]; [/COLOR]// begins animation block[/COLOR]
[COLOR=#098310][COLOR=#000000] [[/COLOR][COLOR=#6f41a8]UIView[/COLOR][COLOR=#3c2280]setAnimationDuration[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#2633d5]0.2[/COLOR][COLOR=#000000]]; [/COLOR]// sets animation duration[/COLOR]
[COLOR=#098310][COLOR=#000000] [[/COLOR][COLOR=#6f41a8]UIView[/COLOR][COLOR=#3c2280]setAnimationDelegate[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#b731a1]self[/COLOR][COLOR=#000000]]; [/COLOR]// sets delegate for this block[/COLOR]
[COLOR=#098310][COLOR=#000000] [[/COLOR][COLOR=#6f41a8]UIView[/COLOR][COLOR=#3c2280]setAnimationDidStopSelector[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#b731a1]@selector[/COLOR][COLOR=#000000](finishedFading)]; [/COLOR]// calls the finishedFading method when the animation is done (or done fading out) [/COLOR]
[COLOR=#098310][COLOR=#000000] [/COLOR][COLOR=#b731a1]self[/COLOR][COLOR=#000000].[/COLOR][COLOR=#6f41a8]view[/COLOR][COLOR=#000000].[/COLOR][COLOR=#6f41a8]alpha[/COLOR][COLOR=#000000] = [/COLOR][COLOR=#2633d5]0.5[/COLOR][COLOR=#000000]; [/COLOR]// Fades the alpha channel of this view to "0.0" over the animationDuration of "0.75" seconds[/COLOR]
[COLOR=#098310][COLOR=#000000] [[/COLOR][COLOR=#6f41a8]UIView[/COLOR][COLOR=#3c2280]commitAnimations[/COLOR][COLOR=#000000]]; [/COLOR]// commits the animation block. This Block is done.[/COLOR]
}
- ([COLOR=#b731a1]void[/COLOR]) finishedFading
{
[COLOR=#098310][COLOR=#000000] [[/COLOR][COLOR=#6f41a8]UIView[/COLOR][COLOR=#3c2280]beginAnimations[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#b731a1]nil[/COLOR][COLOR=#3c2280]context[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#b731a1]nil[/COLOR][COLOR=#000000]]; [/COLOR]// begins animation block[/COLOR]
[COLOR=#098310][COLOR=#000000] [[/COLOR][COLOR=#6f41a8]UIView[/COLOR][COLOR=#3c2280]setAnimationDuration[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#2633d5]0.2[/COLOR][COLOR=#000000]]; [/COLOR]// sets animation duration[/COLOR]
[COLOR=#098310][COLOR=#000000] [/COLOR][COLOR=#b731a1]self[/COLOR][COLOR=#000000].[/COLOR][COLOR=#6f41a8]view[/COLOR][COLOR=#000000].[/COLOR][COLOR=#6f41a8]alpha[/COLOR][COLOR=#000000] = [/COLOR][COLOR=#2633d5]1.0[/COLOR][COLOR=#000000]; [/COLOR]// fades the view to 1.0 alpha over 0.75 seconds[/COLOR]
[COLOR=#518187][COLOR=#000000] [/COLOR]viewController[COLOR=#000000].[/COLOR][COLOR=#6f41a8]view[/COLOR][COLOR=#000000].[/COLOR][COLOR=#6f41a8]alpha[/COLOR][COLOR=#000000] = [/COLOR][COLOR=#2633d5]1.0[/COLOR][COLOR=#000000];[/COLOR][/COLOR]
[COLOR=#098310][COLOR=#000000] [[/COLOR][COLOR=#6f41a8]UIView[/COLOR][COLOR=#3c2280]commitAnimations[/COLOR][COLOR=#000000]]; [/COLOR]// commits the animation block. This Block is done.[/COLOR]
[COLOR=#3c2280][COLOR=#000000] [[/COLOR][COLOR=#518187]splashImageView[/COLOR]removeFromSuperview[COLOR=#000000]];[/COLOR][/COLOR]
}
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310]// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.[/COLOR]
[COLOR=#098310]- (void)viewDidLoad {[/COLOR]
[COLOR=#098310] [super viewDidLoad];[/COLOR]
[COLOR=#098310]}[/COLOR]
[COLOR=#098310]*/[/COLOR]
[COLOR=#098310]/*[/COLOR]
[COLOR=#098310]// Override to allow orientations other than the default portrait orientation.[/COLOR]
[COLOR=#098310]- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {[/COLOR]
[COLOR=#098310] // Return YES for supported orientations[/COLOR]
[COLOR=#098310] return (interfaceOrientation == UIInterfaceOrientationPortrait);[/COLOR]
[COLOR=#098310]}[/COLOR]
[COLOR=#098310]*/[/COLOR]
- ([COLOR=#b731a1]void[/COLOR])didReceiveMemoryWarning {
[COLOR=#098310][COLOR=#000000] [[/COLOR][COLOR=#b731a1]super[/COLOR][COLOR=#3c2280]didReceiveMemoryWarning[/COLOR][COLOR=#000000]]; [/COLOR]// Releases the view if it doesn't have a superview[/COLOR]
[COLOR=#098310]// Release anything that's not essential, such as cached data[/COLOR]
}
- ([COLOR=#b731a1]void[/COLOR])dealloc {
[[COLOR=#b731a1]super[/COLOR] [COLOR=#3c2280]dealloc[/COLOR]];
}
[COLOR=#b731a1]@end[/COLOR]
Ich hoffe ich habe in dem ganzen Wirrwarr nicht irgendetwas vergessen. Wenn Informationen fehlen, kurz Bescheid sagen...