iphone,ios,admobRelated issues-Collection of common programming errors


  • Rob Keniger
    iphone cocoa-touch keyboard decimal nsdecimalnumber
    iPhone/Objective-C/Cocoa newbie here. Based on a number of posts on stackoverflow, I have cobbled together an IBAction that I’m using in a basic iPhone calculator app that I’m building. The IBAction works with the numeric keypad to allow entry of decimal numbers without having to enter a decimal point. I am trying very hard to adhere to the “use NSDecimal when dealing with currency” adage although I am finding it difficult to do so like so many others who have posted questions. I am making stead

  • ikevinjp
    iphone ios
    What is the best practice to log errors/events in an iPhone application? I’m not talking about debugging, but after an app has been released. I mean, I’d like to collect errors/events logs when the app is running in released mode (not debug mode). (When needed I can ask the user to voluntarily send the file to my server for analysis.)(Does NSLog have any effect if it is not running in debug? If so, where does it write to? And, how to clear any contents programatically?)

  • Aman Aggarwal
    iphone json
    When parsing json service , it works fine for first time , but during second time it gave me the error given below -JSONValue failed. Error trace is: ( “Error Domain=org.brautaset.JSON.ErrorDomain Code=11 \”Unexpected end of string\” UserInfo=0x5f57450 {NSLocalizedDescription=Unexpected end of string}” Thanks in advanceCode start parsing: NSString *urlString = [NSString stringWithFormat:@”http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/wa/wsSearch?term=%@”,tt.text];parsing code ::

  • JRoss
    iphone ios ios6 uiwebview uiscrollview
    I currently have a Web View within my MainViewController, which I allow users to swipe gesture left and right in order to go back and forth within their url history (swipe gestures call the ‘goBack’ and ‘goForward’ instance method of the UIWebView Class). Although functional, I would like to improve the user’s experience by having the swipe gestures smoothly transition between old and recently viewed webViews/webSites (similar to the experience of transitioning between between pages in a Scroll

  • user1452248
    iphone
    I placed resumeLayer and PauseLayer method definitions within the @interface and @end block in h file.@interface MainViewController : UIViewController@property (nonatomic, retain) UIToolbar *toolbar; @property (strong)AVAudioPlayer *audioPlayer; @property (nonatomic, retain) NSTimer * timer;- (void)resumeLayer:(CALayer *)layer; – (void)pauseLayer:(CALayer *)layer;@endmethods in m file-(void)pauseLayer:(CALayer*)layer {CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:

  • Neels
    ios iphone facebook facebook-graph-api
    Working on iPhone application for facebook integration, i have already taken some of the permissions from the user as follow :data = ({“basic_info” = 1;email = 1;”friends_birthday” = 1;”friends_photos” = 1;installed = 1;”public_profile” = 1;”user_birthday” = 1;”user_friends” = 1;”user_location” = 1;”user_photos” = 1;});Now I need one more permission from the user to post on his/her wall and that is publish_actionsI am using following code for gaining the user permission :NSArray *permissions

  • Mutix
    iphone uitableview uitableviewcell uiwebview
    I have a class named Announcement, it has a Title (NSString), a Publishing Date (NSString) and a Body (NSString with HTML content). I would like to display it in a similar way like in the Email app. When you read an email you have the first three “rows” (From, To, Title[date]) and then the content of the email. I would want to create only the “Title[date]” row and then the body. I imagine that it to be a UITableView which has on the first cell my Title and on the second cell an UIWebView. But it

  • 14 revs, 2 users 60%user1498513
    iphone xcode afnetworking
    I’m sorry but I am a beginner. How to use AFNetworking to connect website:I have login: xxx password: yyyand i have to do query:{“method”: “authorize”,”params”: [“100000202″,”TestApp677″`]}to endpoint: http://qqqqq.com/authorize/?ver=2_01I read start guide and i added the library,but i do not know how to begin.i have:NSURL *url = [NSURL URLWithString:@”http://qqqqq.com/mobileapi/authorize/?ver=2_01”];NSURLRequest *request = [NSURLRequest requestWithURL:url];AFHTTPClient *client = [[AFHTTPClient

  • null
    iphone objective-c nsuserdefaults
    I used NsUserDefaults for login page. First I enter username and password, push sub viewcontroller then I come again login page and automatically login and push subviewcontroller (I can login automatically 2 times) but third one page stay in login page because of the username and password value empty oturumAcikMi is equal to sessionWhen I write my code in viewDidLoad, I get error message like below so my code is in viewDidAppearnested push animation can result in corrupted navigation bar Unbala

  • Ishant Tiwari
    iphone
    i am facing trouble unexpected issue in iphone app. for whatever reason, i compile this, i get a SIGABRT error. it happens on the:textFieldRounded=[[UITextField alloc]initWithframe: CGRectMake(20,50,280,31)]; textFieldRounded.borderStyle=UITextBorderStyleRoundedRect; textFieldRounded.textColor=[UIColor blackColor]; textFieldRounded.font=[UIFont systemFontOfSize:17.0]; textFieldRounded.placeholder=@”enter your name”; textFieldRounded.backgroundColor=[UIColor whiteColor]; textFieldRounded.autocorr

  • Victor Ronin
    objective-c ios
    I read Apple’s recommendation on exception usage and NSError usage:Also, I read several similar stack overflow questions which discuss whether to use or not exception.Exception Handeling in iOSUsing exceptions in Objective-CObjective-C ExceptionsI am trying to figure out pros and cons of usage exception as error notification/handling method in iOS (Frankly, I am no satisfied with Apple’s sentence (it says what to do, but it doesn’t say why we should do it):You should reserve the use of exceptio

  • ikevinjp
    iphone ios
    What is the best practice to log errors/events in an iPhone application? I’m not talking about debugging, but after an app has been released. I mean, I’d like to collect errors/events logs when the app is running in released mode (not debug mode). (When needed I can ask the user to voluntarily send the file to my server for analysis.)(Does NSLog have any effect if it is not running in debug? If so, where does it write to? And, how to clear any contents programatically?)

  • shanegao
    ios cocoapods
    I just run pod install and got this message in terminal:CocoaPods 0.29.0 is available.2014-02-17 00:25:35.875 ruby[65690:507] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 908. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.??? MARKDOWN TEMPLATE ???????????????????????????????????????????????????????????### Report* What did you do?* What did you expect to happen?* What happened instead?### Stack“`CocoaPods : 0.27

  • bkaid
    ios facebook upload photo
    I’d be grateful for any suggestions as to how to deal with a problem I’m having posting an image to Facebook.The following code works just as I would expect:NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@”http://myserver/img.png”, @”picture”,@”My Testing”, @”name”,@”Enter some text…”, @”message”,nil];[appDelegate.facebook dialog:@”feed” andParams:params andDelegate:self];However, I really want to use an image that I capture from my camera. I’ve set up the cod

  • flexaddicted
    ios ios5 automatic-ref-counting weak strong
    This question already has an answer here:Should IBOutlets be strong or weak under ARC?6 answersI have switched my project to ARC, and I don’t understand if I have to use strong or weak for IBOutlets. Xcode do this: in interface builder, if a create a UILabel for example and I connect it with assistant editor to my ViewController, it create this:@property (nonatomic, strong) UILabel *aLabel;It uses the strong, instead I read a tutorial on RayWenderlich website that say this:But for these two part

  • mmorris
    ios keyboard size uikeyboard nsnotificationcenter
    The following code (sorry for the length) displays an odd behavior under iOS 4.3 (maybe others version too). In this example, there are three UITextFields that have three different sized keyboards. If you start editing one text field and then touch “return” dismissing the keyboard, each time the keyboard size is returned correctly in UIKeyboardWillShowNotification and UIKeyboardDidShowNotification using UIKeyboardFrameBeginUserInfoKey.see below:- (void) keyboardWillShowNotification:(NSNotifica

  • Matt Wilding
    objective-c ios nsurlconnection grand-central-dispatch
    NSData has always had a very convenient method called +dataWithContentsOfURL:options:error:. While convenient, it also blocks execution of the current thread, which meant it was basically useless for production code (Ignoring NSOperation). I used this method so infrequently, I completely forgot that it existed. Until recently.The way I’ve been grabbing data from the tubes is the standard NSURLConnectionDelegate approach: Write a download class that handles the various NSURLConnectionDelegate met

  • chris
    javascript jquery ios cordova
    I am using phonegap 3.0.0And in the process of attempting to upload a file to the server I am getting a couple things that are unexpected. First thing, a script error:Error: SyntaxError: Unexpected token ‘:’ line 624 of phonegap.js(which I think is a lot older version of the js to begin with, as I could only find one on github)Next thing I am getting which I don’t see why/how this would prompt when I have never seen it on other apps.. is a little alert dialog: When I click OK on the dialog thats

  • Rob Caraway
    ios objective-c xcode xcodebuild osx-server
    I’m getting this error when trying to use an Xcode bot to integrate for unit tests:Integration failed. Unexpected error while building. See the integration’s logs for more details.I couldn’t make any sense of the logs. They pretty much spit out any error with the system whether related or not.I use a remote repository from from Github, testing currently on only 1 device. I’m .gitignore-ing the standard stuff from Xcode.Here is the most relevant messages from the log I could find:’2014-01-01 10

  • John Riselvato
    ios csv
    I’m trying to implement a label that shows me the current location’s weather data as the following:NSString *request = [NSString stringWithFormat:@”http://api.worldweatheronline.com/free/v1/weather.ashx?q=%@&format=csv&num_of_days=0&show_comments=no&key=myKeyThatIRemovedForThisQuestion”,city];NSURL *URL = [NSURL URLWithString:request];NSError *error;NSString *csv = [NSString stringWithContentsOfURL:URL encoding:NSASCIIStringEncoding error:&error];NSArray *items = [csv compone

  • Jimmy
    java android eclipse admob proguard
    Ok guys so this becoming extremely annoying trying to get my project to work when exporting/Progaurd keeps giving me this error:Proguard returned with error code 1. See consoleHere is the full error i get in the console:Warning: com.google.ads.m: can’t find referenced class com.google.ads.internal.state.AdState [2012-10-23 18:14:20 – com.fttech.monkey_toss.Menu] Warning: com.google.ads.m: can’t find referenced class com.google.ads.internal.state.AdState[2012-10-23 18:14:20 – com.fttech.monkey_to

  • carexcer
    ios objective-c cocoa-touch admob chartboost
    so after a week of attempting to load chart boost to my non-arc iOS app in Xcode, I’m gonna start asking some really silly questions. my code in my appdelegate is: (void)applicationDidBecomeActive:(UIApplication *)application {[[CCDirector sharedDirector] resume];Chartboost *cb = [Chartboost sharedChartboost];cb.appId = @”530dd707f8975c182ae2c691″;cb.appSignature = @”0d8726e69c911a182b0cefac4eca36f692355725″;// Required for use of delegate methods. See “Advanced Topics” section below.cb.delegate

  • Anton
    android monodroid admob xamarin
    I have a problem. I have an application builded with monodroid libraries. Version of android sdk 4.0.3 (API level 15), GoogleAdMobAdsSdk v.6.4.1. I made separated project to import adsdk to xamarin, add to Metadata.xml attributes. This project compiling without errors. But when i have a reference to this project from my monodroid application i get an error:/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Tool exited with code: 3. Output:

  • MikeS
    ios admob iad ads
    I’m using AdMob’s mediation abilities to deliver both iAds and AdMob ads to my iPhone app. However, I’m noticing something REALLY annoying from some of the AdMob ads… Some AdMob ads are opening webpages directly inside my application, in between my Nav bar and Tab bar, and aren’t displaying correctly. Instead of being fully modal like iAds, they are invading my application’s space (and doing it wrong). Are there ways to single out these AdMob ads and disable just the ones that attempt to op

  • poundifdef
    android ant jar admob build.xml
    I maintain an Android app and am not using Eclipse. I am not using Eclipse. I am using ant and build.xml and build.properties. I have places my .jar file into the libs/ directory. My code compiles just dandy. But when I run it on the emulator, the output APK does not include the .jar, so I get a runtime stacktrace:ERROR/AndroidRuntime(470): java.lang.NoClassDefFoundError: com.google.ads.AdViewmy build.properties looks like this:jar.libs.dir=libsAnd the libs/ directory contains my .jar file.What

  • yann.debonnel
    android maven admob
    I have an Android Project where I need to build multiple versions of the same application from the same sources.To do this, I use the android plugin for MavenEach version must be able to include ads from admob. So in my POM I added this dependancy <dependency><groupId>com.admob.android</groupId><artifactId>ads</artifactId><version>20101109-ANDROID-3312276cc1406347</version><scope>system</scope><systemPath>THE_PATH\libs\admob-sdk-android

  • djItu
    iphone ios admob
    Ive been trying to display an interstitial ad several times during my app runtime. Ive read admob documentation about it and it seems that is a one-time-use object, I’d like to know if there’s any workaround for this. Any help will be appreciated. Thanks

  • Guy Cothal
    java android admob manifest
    I have read through about 2 dozen articles and through the Google documents and my code as it is just gives me a force close box. Here is my codeManifest<?xml version=”1.0″ encoding=”utf-8″?> <manifest xmlns:android=”http://schemas.android.com/apk/res/android”package=”com.ndai.funnys”android:versionCode=”1″ android:versionName=”1.0″ ><uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”15″ /><uses-permission android:name=”android.permission.INTERNET”/><uses-p

  • KeirDavis
    java android view admob
    So here is my code, super.onCreate(savedInstanceState);RollingThunderView a = new RollingThunderView(this);setContentView(a);adView = new AdView(this, AdSize.BANNER, “ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXX”);AdRequest adRequest = new AdRequest();adRequest.addTestDevice(AdRequest.TEST_EMULATOR);adRequest.addTestDevice(“TEST_DEVICE_ID”);adView.loadAd(new AdRequest());android.view.ViewGroup.LayoutParams lp;lp = a.getLayoutParams();lp.width = a.getWidth();lp.height = a.getHeight();this.addContentVie

  • GrIsHu
    android layout admob relative adview
    First off- I have an admob adView set up but I need to create it dynamically due to a bug in the latest release of course.I want the ad on the bottom of the screen, and I have a linearLayout which is set to the bottom BUT there are is a restrictions which have to be otherwise the ad wont load: 1) I need to LinearLayout to be a certain height (NOT wrap content)This all works fine with a test ad, but the problem is…I was going to put this layout in a RelativeLayout so that I can align it to the

Web site is in building