Guest User

Untitled

a guest
Aug 9th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. Image is null [NSCFDictionary setObject:forKey:]: attempt to insert nil value (key:)
  2. MenuItem *button1 = [MenuItemImage itemFromNormalImage:@"playAgainButton.png" selectedImage:@"playAgainButton.png" target:self selector:@selector(button1Callback:)];
  3. MenuItem *button2 = [MenuItemImage itemFromNormalImage:@"changePlayerButton.png" selectedImage:@"changePlayerButton.png" target:self selector:@selector(button2Callback:)];
  4. MenuItem *button3 = [MenuItemImage itemFromNormalImage:@"blank1.png" selectedImage:@"blank1.png" target:self selector:@selector(button3Callback:)];
  5.  
  6. Menu *menu = [Menu menuWithItems: button1, button2, button3, nil];
  7.  
  8. [menu alignItemsVerticallyWithPadding:9];
  9. menu.position = ccp(160,48);
  10.  
  11. [self addChild:menu];
  12.  
  13. return self;
  14. }
  15.  
  16. MenuItem *button3 = [MenuItemImage itemFromNormalImage:@"blank1.png" selectedImage:@"blank1.png" target:self selector:@selector(button3Callback:)];
  17.  
  18. -(void)button3Callback:(id)sender
  19. {
  20. GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init];
  21. if (leaderboardRequest != nil)
  22. {
  23. NSLog(@"leaderboardrequest is not equal nil");
  24. leaderboardRequest.playerScope = GKLeaderboardPlayerScopeGlobal;
  25. leaderboardRequest.timeScope = GKLeaderboardTimeScopeAllTime;
  26. leaderboardRequest.range = NSMakeRange(1,10);
  27. [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error) {
  28. if (error != nil)
  29. {
  30. // handle the error.
  31. NSLog(@"ERROR : %@",[error localizedDescription]);
  32. }
  33. if (scores != nil)
  34. {
  35. // process the score information.
  36.  
  37. for (id thisScore in scores) {
  38. NSLog(@"Score %@ ", thisScore);
  39. }
  40. }
  41. else {
  42. NSLog(@"Scores == nil");
  43. }
  44. }];
  45. }
  46. }
  47.  
  48. 2011-12-20 11:29:40.984 tweejump[2936:707] Image is Null
  49. 2011-12-20 11:29:40.988 tweejump[2936:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: blank1.png)'
  50. *** First throw call stack:
  51. (0x31cca8bf 0x31a3a1e5 0x31cca7b9 0x31cca7db 0x31c376bb 0x35dc9 0x2f63f 0x2f5c5 0x25385 0x252f9 0x2522f 0x43cc7 0x429bb 0x4235f 0x2e95f 0x2f515 0xf26f 0x358db61d 0x31c9ea63 0x31c9e6c9 0x31c9d29f 0x31c204dd 0x31c203a5 0x31d2cfed 0x327b0743 0x2873 0x282c)
Add Comment
Please, Sign In to add comment