iphone,objective-c,ios,class,interfaceRelated issues-Collection of common programming errors


  • db2
    vpn sonicwall iphone l2tp ipad
    A client has a Sonicwall Pro 2040 running SonicOS 3.0, and they’d like to be able to use the L2TP VPN client from their iPads to connect to internal services (Citrix, etc). I’ve enabled the L2TP VPN server on the Sonicwall, made sure to set AES-128 for phase 2, and set up the configuration on a test iPad with the appropriate username, password, and pre-shared key. When I attempt to connect, I get some rather cryptic error messages in the log on the Sonicwall:2 03/29/2011 12:25:09.096 IKE Respo

  • Götze
    iphone ios xcode git osx
    I am setting up one git client on Mac (Using Source Tree). While committing the code it is showing the following error(please check the screen-shot). Any idea to solve this error ?ERROR :

  • hjon
    iphone core-location
    Is kCLErrorNetwork “fatal”, i.e. can location still be acquired or should we tell Core Location to stop updating the location?In iOS 3.0, Core Location added an error code, kCLErrorNetwork. It is described as a “general, network-related error”. Does this mean that neither the cell network nor Wi-Fi is available and Core Location can only use GPS? Or something else?

  • Giffyguy
    iphone
    how to handle error in an iphone app ? log and exit ? show an alert dialog and exit ? for exemple, if an image is missing from the bundle..even though it should not …

  • kiran
    iphone ipad
    /Desktop/aug_9/iOSSample/iOSSample/test.m:11:10: fatal error: ‘nDCAPI.h’ file not found #include <nDCAPI.h>^ 1 error generated.I got this error even i include the file in my project Right click on project and add file to project and selected the file and selected Destination and folders i create folder references for any added folders.for adding the file into the project! I got this error /Desktop/aug_9/iOSSample/iOSSample/test.m:11:10: fatal error: ‘nDCAPI.h’ file not found#include ^1 er

  • Udi I
    iphone monotouch xamarin
    I am trying to understand the reason my app crashes, randomly it seems, when trying to present a view. The button click code:if ( d.rootNavigationController.RespondsToSelector(new MonoTouch.ObjCRuntime.Selector(“presentViewController:animated:completion:”))){d.rootNavigationController.PresentViewController(childBroswer, true,null);}else{d.rootNavigationController.PresentModalViewController(childBroswer, true);}This is the stack trace:at MonoTouch.UIKit.UIApplication.Main (string[],string,string)

  • PeeHaa
    iphone fatal-error
    Ok, I only made a minor change to a project of mine in Xcode (I just added a new .h, .m, and .xib file, they’re very small), and now it won’t run and gives me this message:”fatal error: error writing to -: Broken pipe”WTF? So I removed all the changes and tried to run it again and it STILL gives me the error, what’s the deal?

  • Elisabeth
    javascript iphone ipad orientation
    I’m having the same problem that a couple of others have had with getting the correct behavior in a web app on an orientation change, and there doesn’t seem to be an obvious solution – I’ve seen this question asked a couple of times on Stack Overflow and no one’s yet been able to answer it.When I start the app in portrait mode, it works fine. Then I rotate into landscape and it’s scaled up. To get it to scale correctly for the landscape mode I have to double tap on something twice, first to zoo

  • Shekhar Gupta
    iphone xcode terminal
    Is there some way by which I can use Xcode only to organise my code and not display errors at the time of compilation? I want that the error messages and the output get displayed in the Terminal instead. I am a college student and am learning how to program in C. I really want the error messages to be displayed in the Terminal, as they are shown there in a fairly cryptic manner, instead of the user friendly manner which is there is in Xcode.

  • soshiki
    c# iphone mono monotouch monodevelop
    I have a project set up in MonoDevelop, it compiles and runs fine for the simulator but when I try to target a device I get a compile error saying:Error 1: mtouch failed with no output (1) (ChicksnVixens-MonoTouch)And this is the last bunch of stuff the build output has (paste bin: http://pastebin.com/Ea8hgaFH):Compiling to native code /Developer/MonoTouch/usr/bin/mtouch -v–nomanifest –nosign -dev”/Users/dev/Documents/Proj/cnv/MyCode/ChicksnVixens/bin/iPhone/Debug/ChicksnVixens-MonoTouch.app””

  • user1118321
    objective-c cocos2d-iphone
    What does this error mean ? Following is my code. But I don’t see anything wrong -(id) init {if( (self=[super init] )) {CGSize winSize = [[CCDirector sharedDirector] winSize];CCSprite *player = [CCSprite spriteWithFile:@”Player.png” rect:CGRectMake(0, 0, 27, 40)];player.position = ccp(player.contentSize.width/2, winSize.height/2);[self addChild:player]; }if( (self=[super initWithColor:ccc4(255,255,255,255)] )) {}return self; }

  • Jim Thio
    objective-c xcode4.3 autorelease
    from: In which situations do we need to write the __autoreleasing ownership qualifier under ARC?( BOOL )save: ( NSError * __autoreleasing * );The compiler will then have to create a temporary variable, set at __autoreleasing. So:NSError * e = nil; [ database save: &error ];Will be transformed to:NSError __strong * error = nil; NSError __autoreleasing * tmpError = error; [ database save: &tmpError ]; error = tmpError;Okay, now the transformed code seems to work just fine. At the end I exp

  • Hermann Klecker
    objective-c button
    I have a problem with my Xcode app, When I push a button, my app crashes.Here is my button’s action, I also declared variables, strings, etc… but it isn’t in this code:{NSLog(@” – Writing Data.plist Labels”);NSString *error;NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];NSString *plistPath = [rootPath stringByAppendingPathComponent:@”Data.plist”];NSDictionary *plistDict = [NSDictionary dictionaryWithObjects:[NSArray arrayW

  • gadgetmo
    objective-c ios xcode exc-bad-access
    I have got this code which creates an image:NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; background = [[UIImageView alloc]initWithFrame:CGRectMake(150, 60, 180, 180)]; result = [[UIImageView alloc]initWithFrame:CGRectMake(150, 60, 180, 180)]; [background setImage:[UIImage imageNamed:[defaults objectForKey:@”colour”]]]; [self.view addSubview:background]; [self.view insertSubview:result aboveSubview:background];This is in my viewWillAppear. When I press a button, this happens:

  • borrrden
    objective-c gnustep
    I am new to objecive-c, i have ubuntu machine and compiling objective-c using GNUStep. I wrote the following code:#import <objc/objc.h> #import <Foundation/Foundation.h> #import <objc/NSArray.h>int main ( int argc, char ** argv) {int ar[100] = {0};int i;NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];NSArray *arr = [[NSArray alloc] initWithObjects:@”stackOverflow”, @”1″, @”2″, nil]; NSLog (@ “Counts in the array %i”, [arr count]);@try {NSString *str;str = [arr object

  • Brock Woolf
    objective-c cocoa cocoa-touch nsstring
    I have an NSString like so:@”200hello”or @”0 something”What I would like to be able to do is take the first occuring number in the NSString and convert it into an int. So that @”200hello” would become int = 200.and @”0 something” would become int = 0.

  • Bartosz Ciechanowski
    objective-c lambda objective-c-blocks continuations structured-programming
    When using methods which return blocks they can be very convenient. However, when you have to string a few of them together it gets messy really quicklyfor instance, you have to call 4 URLs in succession:[remoteAPIWithURL:url1 success:^(int status){[remoteAPIWithURL:url2 success:^(int status){[remoteAPIWithURL:url3 success:^(int status){[remoteAPIWithURL:url2 success:^(int status){//succes!!!}];}];}]; }];So for every iteration I go one level deeper, and I don’t even handle errors in the nested

  • Rakhe Kara
    ios iphone objective-c cocoa-touch
    Actually this crash is not reproducing every time, even not frequently but we got this crash in our production app. I am not sure where is the problem. It is telling crash is happening in thread 4 in Environments class line number 38.Code:NSBundle* bundle = [NSBundle mainBundle];NSString* envsPListPath = [bundle pathForResource:@”Environment” ofType:@”plist”];Line 38: NSDictionary *environments = [[NSDictionary alloc] initWithContentsOfFile:envsPListPath];But according to exception type:00000020

  • Musterknabe
    ios objective-c
    I have the following problem. I have a Model, called User. When the user now logins with Facebook, my app checks if the user exists already in the database. To not freeze the UI (since I’m coming from Android) I thought to use NSURLConnection sendAsynchronousRequest. What worked at first was the following:My User Model had a method to do the whole task of the AsynchronousRequest and then when finished would set a variable to loading. Then other classes, could simply check with while ( !user.loa

  • Josh Bradley
    objective-c sockets bsd-sockets
    Ok, I have a problem with building a socket using Objective-C. If you’ll take a look at my code below, through help with example code and other sources, I was able to build a complete socket I believe. The problem is that when I compile it, it builds fine (no syntax problems), but there are no sockets being created. As you’ll notice I’ve commented out a lot of things in Server2.m and have isolated the problem to the very beginning when I create the struct for the listeningSocket. By the way, if

  • Michael Petrotta
    ios xcode ios7
    I get this error when building my app in the latest version of Xcode:fatal error: malformed or corrupted AST file: ‘Unable to load module”/Users/me/Library/Developer/Xcode/DerivedData/ModuleCache/XYZYIE6ZV0OP/Darwin.pcm”:file not found’ note: after modifying system headers, please deletethe module cache at’/Users/me/Library/Developer/Xcode/DerivedData/ModuleCache/XYZYIE6ZV0OP’1 error generated.When I navigate to: /Users/me/Library/Developer/Xcode/DerivedData/ModuleCacheI can see that the directo

  • Broken Heart ?
    ios xcode compiler-errors
    Building an iPhone app, using:XCode 4.1 Base SDK iOS 4.3 Apple LLVM Compiler 2.1I have started getting the following error:fatal error: file’/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/../lib/clang/2.1/include/stdint.h’has been modified since the precompiled header was builtI have tried reinstalling XCode and OS X – no luck. Anyone know what’s causing this?

  • Götze
    iphone ios xcode git osx
    I am setting up one git client on Mac (Using Source Tree). While committing the code it is showing the following error(please check the screen-shot). Any idea to solve this error ?ERROR :

  • Abdulla
    ios ipad dyld
    I am building an Xcode project with Unity3D to multiple devices. The app runs fine on an iPhone 3GS, iPhone 4, iPod Touch 5, and iPad 4.Earlier builds ran fine on an iPad 1. However, the current build will not run on the iPad 1, showing the error:dyld: Library not loaded: /System/Library/Frameworks/Social.framework/SocialReferenced from: /var/mobile/Applications/F64896A2-EDCB-458A-9927-B86DF3F06E5A/myapp.app/myappReason: image not foundI have made sure that the Social.framework Framework is bein

  • Jeff Loughlin
    ios error-handling
    When something goes so horribly wrong that my app can’t continue and needs to exit, I want to pop up an alert box to the user, and then close the app when they tap the OK button. Sounds simple enough, right?But here’s the problem: my fatal error handler gets called by a 3rd party library (I don’t have their source code). I give them a pointer to my fatal error handler on initialization, and when they encounter a fatal error they simply call that routine and expect it to never return. If it r

  • gadgetmo
    objective-c ios xcode exc-bad-access
    I have got this code which creates an image:NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; background = [[UIImageView alloc]initWithFrame:CGRectMake(150, 60, 180, 180)]; result = [[UIImageView alloc]initWithFrame:CGRectMake(150, 60, 180, 180)]; [background setImage:[UIImage imageNamed:[defaults objectForKey:@”colour”]]]; [self.view addSubview:background]; [self.view insertSubview:result aboveSubview:background];This is in my viewWillAppear. When I press a button, this happens:

  • Daniel
    ios memory-management xcode5
    I am new to Objective C so this code is probably not written that well. When the app is launched, it calls the following code if it has not been saved into the phone yet. When it starts to loop through the while loop, the app crashes on any phone the is not the iphone 5s. I think this is due to the memory usage. I believe that inside the while loop, when the NSMutableString (movieTitle) is created, is where the memory spike is. I should also add that the amount of times the loop is iterated is a

  • user2541100
    ios audiounit
    I am playing sound file(.caf) that play and make sine waves like audiounit and augraph works. It is playing fine and showing sine waves perfectly in simulator. But when i run it on iPad it is not working(no sound and no waves).I have tried many things but nothing works. But i do analyse one thing that when i run it on simulator Bool value is Stereo is Yes.But when it runs on iPad is Stereo becomes NO and number of channels becomes 1 from 2.Any help would be appreciated.My code is -static OSStatu

  • Kara
    ios xcode core-data memory
    With my App I have a pre-populated sqlite DB that I created using core data from another app I created so the Data model is the same. I copy it over and everything works great. I tried it on every iOS device that can run iOS 6.0 because that is what I am building for. Even on the early iPod Touches the App works. It takes around 45 secs for the DB to copy over on the older devices. The app works all the data is there and all devices the tests were great and no issues. I released the app on

  • Ricardo Cerqueira
    ios xcode crash cocos2d adhoc
    my app runs fine on development mode, but for some reason on ad hoc i get a crash right after loading screen.I really can’t understand what could be wrong, any tips on how to test it better?Apple rejected it with this message:We found that your app failed to launch on an iPhone 5 and iPad 3rd gen running iOS 6.1.3, on both Wi-Fi and cellular networks.We encountered the issue when selecting the application on the Home screen – the app displayed a launch image then quit unexpectedly. This may be b

  • php-b-grader
    php class
    I’m getting this error:Fatal error: Cannot redeclare class CustomerThen I added the following code:if (!class_exists(‘Customer’)) {include(‘include/customer.class.php’); }Why do I still get that error?I have a file (file1.php) which has the Customer() class declared.In file1.php I make an ajax call to file2.phpIn file2.php I declare the Customer() class again.In file2.php there is only 1 declaration of Customer() class.

  • campagnolo_1
    class symfony2
    The project works in my local environment but when I deploy it on shared web server it doesn’t work.Server/home/app/src/gestor/UsuarioBundle… /vendors…./public_html/webapp.php…If I go to host/app.php ->Fatal error:Class ‘Gestor\UsuarioBundle\UsuarioBundle’ not found in /home/esdrhazc/app/AppKernel.php on line 19AppKernel.phpuse Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface;class AppKernel extends Kernel {public function registerBundles(){$bundle

  • bbullis
    php class oop namespaces autoload
    I have a function on load that checks a users login status. Here is a small chunk of the code…// // user is logged in, get user info $user = Model\User::getByKey($_COOKIE[‘ukey’]); if($user->field(‘id’) >= 1 || !isset($status)) {//// establish google connectionClasses\Google\Google::construct($user->field(‘id’), $user->field(‘ga_account’));…I have an __autoload function which finds the path of the file perfectly fine. However, I get a fatal error because the “\Classes\Google\Go

  • Cyclone
    php class codeigniter
    I’m receiving this fatal error message: Using $this when not in object context. This class is setted up as a library in the CodeIgniter.This is my class:class My_class {function __construct(){$this->app = base_url(‘application’) . ‘/cache/’;if ($this->expire_after == ”){$this->expire_after = 300;}}static function store($key, $value){$key = sha1($key);$value = serialize($value);file_put_contents( $this->app . $key.’.cache’, $value);} }I’m initializing it via autoload.php. The line it

  • Flexo
    php class swig declaration
    I have a problem with wrapping my c++ class in PHP using swig: my class is declared as below in header file:#include <string.h> using namespace std; class Ccrypto {int retVal; public:int verify(string data, string pemSign, string pemCert);long checkCert(string inCert, string issuerCert, string inCRL);int verifyChain(string inCert, string inChainPath);int getCN(string inCert, string &outCN); };each of these methods consists of several functions. My interface file is as below:%module Ccr

  • Sjmon
    class codeigniter download controller version
    i have download the new codeigniter 2.0 and put my controller,model and view files in the new codeigniter 2.0 installation. but i got this error Fatal error: Class ‘Controller’ not found in /Applications/MAMP/htdocs/site/application/controllers/forside.php on line 3What im doing wrong? it works with the old codeigniter version but the new one.. No :SHope some one can help me out

  • xdazz
    php sql class
    I am getting two columns from llamadas where idLlamadas is the primary key, I want to get these values so I can use them later but when I try to use the primary key on $v … I am getting this error: Fatal error: Class ‘2’ not found in … I did some tests and it looks like the ‘2’ is a value in idLlamadas, it gives me the same error if it is 1, 2, 3, 4, etc. it conflicts with the first value.code:$q = (“SELECT idLlamadas, comentarios FROM llamadas”); $sql = mysqli_query($con, $q);foreach ($sql-

  • hakre
    php class codeigniter
    i have a error to use of multiupload with CodeIgniter: this is error:Fatal error: Call to protected method CI_Upload::_prep_filename() fromcontext ‘Multi_upload’ inD:\xampp\htdocs\CodeIgniter_2.0.0\application\libraries\Multi_upload.phpon line 91and line 91 in multi_upload.php:// Set the uploaded data as class variables$CI->upload->file_temp = $_FILES[$field][‘tmp_name’][$i]; $CI->upload->file_name = $CI->upload->_prep_filename($_FILES[$field][‘name’][$i]); // this is li

  • user3012044
    arrays class
    When trying to define a class that contains an array of 5 elements, defaulted to zero, I receive the following errorHeader fileclass Array { public: Array (int =5); //Initialize the array with 0 valuesprivate: int size; // size of created array int* arr; };Source#include<iostream> #include”Array.h” using namespace std; Array::Array (int i) {arr = new int[5]; for(int j = 0; j<size; j++)*(arr + i) = 0; }Driver#include<iostream> #include”Array.h” using namespace std; void main(

  • Second Rikudo
    php class
    I have the following relevant code:try {self::$db = new PDO($dsn, self::USER, SELF::PASS); //Connect to the database, and store the pdo object.self::$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) {throw new Exception(“There have been an error in the connection: “. $e->getMessage()); }When executing the static function this code is in, I get the following error:Fatal error: Class ‘SELF’ not found in P:ath/to/script.php on line 107I have no idea what m

  • Mare Infinitus
    c# multithreading interface
    Some time ago, I found the following log4net wrapper hereBut I think it is errorprone (in case of threading, could there be deadlocks?) and the public interface seems to be too wide.What to do about it?Here is the code, just as in the source:using System; using System.Collections.Generic; using System.Globalization; using System.IO; using log4net; using log4net.Config;namespace Core {/// <summary>/// Log4Net wrapper, lifted from codecampserver (http://code.google.com/p/codecampserver/sourc

  • Aubrey
    12.04 command-line boot upgrade interface
    This question already has an answer here:Cannot login to my user account6 answersI recently upgraded my computer to Ubuntu 12.04 from 10.04 and it started messing up, as in, freezing up on certain programs and then randomly logging out and going to the log-in screen. I’ve done all of the upgrades and it still wasn’t working properly.Now when I turn the computer on, instead of booting to the GUI Interface, it boots straight to the terminal. Is there any command I can type to boot it properly?

  • Aaron Digulla
    java c interface native
    I’m trying to recreate this tutorial on Windows: Java Native Interface (JNI)When I try to compile it I get the following error:fatal error: jni.h: No such file or directory#include <jni.h>compilation terminated.My command line is:gcc -Wl,–add-stdcall-alias -IC:\Program_Files\Java\jdk1.7.0_45\include -IC:\Program_Files\Java\jdk1.7.0_45\include\win32 -shared -o hello.dll HelloJNI.cI compile in the folder where all the files are. I am sure that the file “jni.h” in this folder is located:C:\P

  • Cerbero
    php oop interface error-handling fatal-error
    How can I customize the error message when a class which implements an interface doesn’t contain requested methods?Actually I get:Fatal error: Interface function X cannot contain body in Y on line Z

  • Mike
    android listview android-fragments interface
    I have an interesting fragment with multiple spinners. THe first spinner, loads the data into the second spinner based on what was selected. It looks something like this:When the fragment first loads the first spinner is “All” and it fills the listView with all the beers. Right now this is the only listView I can click on items without them force closing. The code for my portfolio is:public class Portfolio extends Fragment implements PortfolioGetAllBeers.OnArticleSelectedListener {String beerId

  • dostiguy
    spring caching interface key illegalargumentexception
    While implementing, I came across a problem with Spring Cache Abstraction VS interfaces. Lets say I have the following interface:package com.example.cache;public interface IAddItMethod { Integer addIt(String key); }And the two following implementations:package com.example.cache;import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component;@Component public class MethodImplOne implements IAddItMethod {@Override@Cacheable(value=”integersPlusOne”, key=”

  • Robert Harvey
    java windows interface com
    I need to access a Windows COM interface using my Java application. The COM interface in inbuilt in the executable for the program I’m talking to. I tried com4j but keep getting this exception, I’m running it only from the command prompt for now-cmd:> java -jar tlbimp.jar -o exe -p abc.exe executableFile.exeException in thread “main” com4j.ExecutionException: com4j.ComException: 80029c4 a LoadTypeLib failed : Error loading type library/DLL. : .\com4j.cpp:398at com4j.ComThread.execute(ComThrea

  • lhw
    java interface callback jni
    I am trying to use (*env)->RegisterNatives to add methods to a defined class which I then add to a callback list. The callback sender of course expects my class to implement a certain interface which I do not. And is failing on execution.If I add the keyword “implements Listener” to my class in Java the javac expects to have the methods definition in Java or with native keyword which I try to avoid here, as I’d like to register the methods within the JNI_OnLoad and execute one of them afterwa

  • giacomotb
    android interface android-asynctask nullpointerexception runtime-error
    I’m writing a program that download data from a database, and when I was using the onPostExecutemethod for elaborate data everything works fine. Because I needed this data in the class that calls the AsynkTask class, I used the method new AsynkTaskClass.execute().get() and it worked. Ultimately I implemented an Interface instead of the .get() method and the program crashes. When I debug it, it crashes in a line of the method updateJSONData(), called in doInBackground, and the strange part is tha

  • better_use_mkstemp
    interface weblogic ejb-3.0 jndi
    My ejb 3 classes and remote interface are as follows :package com.myeclipse.ejb3;import java.io.Serializable;public interface IMyBean extends Serializable {public void doSomething(); }Remote interface:package com.myeclipse.ejb3;import javax.ejb.Remote;@Remote public interface MyBeanRemote extends IMyBean {}Stateless ejb:package com.myeclipse.ejb3;import javax.ejb.Stateless;@Stateless(mappedName=”ejb/MyBean”) public class MyBean implements MyBeanRemote { public void doSomething() {System.out.pr

Web site is in building