Troubleshooting of advertising problems with iPhone OS 4 and Other iPhone Systems

Source: Internet
Author: User

The advertisement required to be loaded for iPhone OS 4 is IAD. In the previous iPhone operating systems, IAD ads were not supported. Therefore, we need to load admobview ads. Therefore, we cannot load IAD through the XIB file. However, there is no problem. We can load the advertisement as follows:

 

Class myclass = nsclassfromstring (@ "adbannerview ");
If (myclass! = Nil ){
Cgfloat rate = [[uiapplication sharedapplication] keywindow]. Frame. Size. width/640.0;
Adbannerview * adview = [[adbannerview alloc] initwithframe: cgrectmake (0, 88 * rate, 640 * rate, 100 * rate)];
Adview. tag= 1101;
Adview. Delegate = (ID) self;
[Self. View addsubview: adview];
[Adview release];
} Else {
Admobad = [admobview requestadwithdelegate: Self];
[Admobad retain];
}

You can load the advertisement through the above method.

However, there is another problem, that is, the IAD import of library files. We must change the link mode to the weak link mode. Otherwise, the program cannot run on the system before the iPhone OS 4.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.