ADBannerView delegate methods never triggering - cocos2d-iphone

Question is as simple as the tip of the question.
banner is working in test mode in device.(seems like so: "You re connected to the iAd Network").
declared -didFailToReceiveAdWithError, -bannerViewDidLoadAd and -bannerViewActionShouldBegin.
and ADBannverView1.delegate assigned to self (is a cocos2d CCLayer)
but these methods never called. I drop some breakpoints that never runs into.
have you any idea ?
Question 2: what is the difference between these property definations ? should I use weak, assign ? or IBOutlet is a necessarry ?I tried all 3 combination and all worked.
#property(nonatomic,retain) ADBannerView *iAdView;
#property(nonatomic,retain) IBOutlet ADBannerView *iAdView;
#property(nonatomic,assign) ADBannerView *iAdView;

For me the problem was that I also had this line in my code self.canDisplayBannerAds=YES;
After I removed it delegate method were called properly.

Related

How to turn on showPhysics in a Swift UI SpriteView?

I have been playing with the SpriteView in iOS14 and its working quite well however, I noticed that some collisions that worked fine when using a UIViewcontroller would be missed using the SpriteView. So I thought to turn on showsPhysics to help with the debug. However I am stumped as to how I can do that as the skView is not available?
Can anyone help, I must be missing something.
cheers
S
So now I feel a bit dumb. The answer was to put the view.showsPhysics = true into the didMove(to view: SKView) call!
it is simple, you just need to add a new parameter wend you initialize the SpriteView:
SpriteView(scene: SKScene(), debugOptions: .showsPhysics)

Swift 3 - AWS iOS 'EXC_BAD_INSTRUCTION' Error

After converting over to Swift 3, my AWS iOS App now crashes when being run.
Has anyone seen anything similar after converting over to Swift 3?
Its crashing because you are doing a few things here:
trying to return a method call (which I don't think is possible - but I've never tried it)
application: didFinishLaunching should only ever return true because it's a boolean function as the name suggests. So the return value should be true. If you'd like to override application: didFinishLaunching you can declare that later in your AppDelegate
So here's what you can do... Try deleting the method and slowly type it back until Xcode auto-completes it for you. That will allow you to see what has been depreciated, or what other methods might be useful, also if you haven't yet hit Command + Shift + K to run a clean on your project. Xcode 8 and Swift 3 might have altered a few more things you aren't aware of.
launchOptions is an optional parameter. Doing a forced unwrap with the ! will crash if the value is nil, which it usually is.

Cocos2D iPhone Extensions v0.2.1: CCMenuAdvanced warning: CCMenu may not respond to initWithItems:vaList: Should I be concerned?

Looked in the CCMenu.h and it looks like it responds to the exact method Xcode (4.5.2) is saying it doesn't respond to. I've tried overriding the method and extending CCMenu, but it always throws the same message.
When I build and run my project, it seems to work fine. Should I ignore this warning and continue with my game? Another question: Is there a simple way to 'update' this code to a non-deprecated or outdated method? Here's the cocos2d-iphone-extensions version I'm using. Also, it's cocos2d 2.1.
The error is generated on line 76 of the .m file.
CCMenuAdvanced.h:
https://github.com/cocos2d/cocos2d-iphone-extensions/blob/master/Extensions/CCMenuAdvanced/CCMenuAdvanced.h
CCMenuAdvanced.m:
https://github.com/cocos2d/cocos2d-iphone-extensions/blob/master/Extensions/CCMenuAdvanced/CCMenuAdvanced.m
You are getting this warning because -(id) initWithItems: (CCMenuItem*) item vaList: (va_list) args is not present in the header file (CCMenuAdvanced.h).
You need to use + (id) menuWithItems: (CCMenuItem*) firstItem vaList: (va_list) args; from CCMenu (superclass of CCMenuAdvanced).

NSMatrix, NSForm - addRow - why above and not below?

I'm running into a strange behavior with NSForm (and also NSMatrix).
(1) Using interface builder (in Xcode 4.3.1) I place an NSForm in a window. I add a NSButton and wire it to an IBAction that sends addRow to the NSForm.
- (IBAction) addRow:(id)sender
{
[form addRow];
[form sizeToCells];
}
The problem is that the new row is added ABOVE the existing row, not below as it's supposed to. I thought this was a problem coming from somewhere else in my app, but I created a new project in Xcode and this happens even in the simplest app.
I must be doing something stupid wrong, but I can't find it. Any suggestions would be appreciated.
[form setFrameOrigin:NSPointFromCGPoint(CGPointMake([radioButtons frame].origin.x, [radioButtons frame].origin.y-20))];

How do you call a function using self in cocos2d 0.99.5

Yes I am a begginer. I am reading a book on cocos2d development. The author wrote this book using 0.99.4. In the book, it says to call a function that creates sprites and adds them to an array by using the following code: [self initSpiders];. But when I run this, I get a warning that says "'Gamescene may not respond to'-resetSpiders'". I am assuming that there is an updated way of doing this in the newer version of cocos2d. If there is, I would be thankful if someone could explain the proper way of going about this. If this is the correct way, then what am I doing wrong? Thanks in advance.
In objective-c, an object tells a message to do something:
[someObject doSomething];
Or with an argument:
[someObject doSomethingWithArgument:someValue];
The message you get from the compiler is telling you that the object (eg. "someObject") does not understand what you are telling it to do (doSomething).
To make that compiler warning go away, check the following:
Did you #include the header file of the class your "someObject" is an instance of?
Does that header file in fact have the method you are calling? (including arguments?)
If you are calling a method you wrote, make sure you put that method in the header file. If you are calling a method that someone else wrote, or is part of the OS; make sure you include the header file, then perhaps find the method in the header file and copy/paste it into your code. This will make sure you get the EXACT method signature. These two are not the same:
[self generateSprites]; // note the capitol S
[self generatesprites]; // method names are case sensitive
If you need a better answer, you'll need to post some of your code so that people can see what you're doing wrong.