Search Results

Search found 2166 results on 87 pages for 'obj'.

Page 5/87 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • One project in Delphi 2007 doesn't show procedure name in the IDE Obj Inspector's Events

    - by lgallion
    I have a Delphi project in 2007 that doesn't show the procedure names in the Object Inspector's Events such as Form OnClose, OnCreate or OnShow in the IDE. The code is there and if you click on OnCreate (for example) you are taken to the code and the IDE fills in the name of procedure. However on reload, the procedures are missing from the IDE again. This same project causes various error messages when Delphi closes also, but I am not sure if this is related (no other project developed under this Delphi does but this one is the largest app and uses several 3rd party add-in libraries). I have moved this app to various Delphi 2007 installations and it reacts the same, so it isn't a corrupt Delphi situation. Is there any way to rebuild or fix a corrupt project like this? Any help would be appreciated.

    Read the article

  • How Can I Check an Object to See its Type and Return A Casted Object

    - by Russ Bradberry
    I have method to which I pass an object. In this method I check it's type and depending on the type I do something with it and return a Long. I have tried every which way I can think of to do this and I always get several compiler errors telling me it expects a certain object but gets another. Can someone please explain to me what I am doing wrong and guide me in the right direction? What I have tried thus far is below: override def getInteger(obj:Object) = { if (obj.isInstanceOf[Object]) null else if (obj.isInstanceOf[Number]) (obj:Number).longValue() else if (obj.isInstanceOf[Boolean]) if (obj:Boolean) 1 else 0 else if (obj.isInstanceOf[String]) if ((obj:String).length == 0 | (obj:String) == "null") null else try { Long.parse(obj:String) } catch { case e: Exception => throw new ValueConverterException("value \"" + obj.toString() + "\" of type " + obj.getClass().getName() + " is not convertible to Long") } }

    Read the article

  • Obj-C: ++variable is increasing by two instead of one

    - by Eli Garfinkel
    I am writing a program that asks users yes/no questions to help them decide how to vote in an election. I have a variable representing the question number called questionnumber. Each time I go through the switch-break loop, I add 1 to the questionnumber variable so that the next question will be displayed. This works fine for the first two questions. But then it skips the third question and moves on to the fourth. When I have more questions in the list, it skips every other question. Somewhere, for some reasons, the questionnumber variable is increasing when I don't want it to. Please look at the code below and tell me what I'm doing wrong. Thank you! Eli import "MainView.h" import @implementation MainView @synthesize Question; @synthesize mispar; int conservative = 0; int liberal = 0; int questionnumber = 1; (IBAction)agreebutton:(id)sender { ++liberal; } (IBAction)disagreebutton:(id)sender { ++conservative; } (IBAction)nextbutton:(id)sender { ++questionnumber; switch (questionnumber) { case 2: Question.text = @"Congress should pass a law that would ban Americans from earning more than one hundred million dollars in any given year."; break; case 3: Question.text = @"It is not fair to admit people to a university or employ them on the basis of merit alone. Factors such as race, gender, class, and sexual orientation must also be considered."; break; case 4: Question.text = @"There are two Americas - one for the rich and one for the poor."; break; case 5: Question.text = @"Top quality health care should be free for all."; break; default: break; } } @end

    Read the article

  • SubViewTwoController undeclared (first use in this function) (obj-c)

    - by benny
    Ahoy hoy everyone :) Here is a list of links. You will need it when reading the post. I am a newbie to Objective-C and try to learn it for iPhone-App-Development. I used the tutorial linked in the link list to create a standard app with a simple basic Navigation. This app contains a "RootView" that is displayed at startup. The startup screen itself contains three elements wich all link to SubViewOne. I have got it to work this far. So what i want to change is to make the second element link to SubViewTwo. When i "Build and Go" it, i get the following errors: RootViewController.m: SubViewTwoController *subViewTwoController = [[SubViewTwoController alloc] init]; // SubViewTwoController undeclared (first use in this function) and in SubViewTwoController.m [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview no superclass declared in @interface for ´SubViewTwoController´ and the same thing after - (void)dealloc { [super dealloc]; I think you will also need the header files, so here they are! RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController : UITableViewController { IBOutlet NSMutableArray *views; } @property (nonatomic, retain) IBOutlet NSMutableArray *views; @end SubViewOneController.h #import <UIKit/UIKit.h> @interface SubViewOneController : UIViewController { IBOutlet UILabel *label; IBOutlet UIButton *button; } @property (retain,nonatomic) IBOutlet UILabel *label; @property (retain,nonatomic) IBOutlet UIButton *button; - (IBAction) OnButtonClick:(id) sender; @end and SubViewTwoController.h #import <UIKit/UIKit.h> @interface SubViewTwo : UIViewController { IBOutlet NSMutableArray *views; } @end I would be really great if you would leave your ideas with a short explanation. Thanks a lot in advance! benny

    Read the article

  • Obj-C memory management: why doesn't this work?

    - by igul222
    Why doesn't the following code work? MyViewController *viewController = [[MyViewController alloc] init]; [myWindow addSubview:viewController.view]; [viewController release]; As I understand, myWindow should be retaining viewController.view for as long as the window needs it. So why does this cause my app to crash on launch? (commenting out the last line fixes the problem, as expected)

    Read the article

  • Obj-c categories in static library

    - by Vladimir
    Can you guide me how to properly link static library to iphone project. I use staic library project added to app project as direct dependency (target - general - direct dependecies) and all works OK, but categories. A category defined in static library is not working in app. So my question is how to add static library with some categories into other project? And in general, what is best practice to use in app project code from other projects?

    Read the article

  • Problem displaying Vertex Buffer Object (OpenGL and Obj-C)

    - by seaworthy
    Hey, I am having a problem displaying or loading a buffer with an array of vertices. I know that array works fine because I am able to render it using a loop and a glVertex command. I can't figure out what's wrong. Your insight is highly appreciated. GLuint vboId; glGenBuffers( 1, &vboId ); glBindBuffer( GL_ARRAY_BUFFER, vboId); glBufferData( GL_ARRAY_BUFFER, count*sizeof( GLfloat ),array,GL_STATIC_DRAW_ARB ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); printf("%d\n",count); glEnableClientState( GL_VERTEX_ARRAY ); glBindBuffer( GL_ARRAY_BUFFER, vboId ); glVertexPointer( 3, GL_FLOAT, 0, 0 ); glDisableClientState( GL_VERTEX_ARRAY ); printf("vboId: [%hd]",vboId); glDeleteBuffers(1, &vboId); Help?

    Read the article

  • Whats the best way to stop this app crash when buttons rapidly pressed iphone obj-c

    - by dubbeat
    Hi, I'm not entirely sure why this crash is happening and I'd like to get advice on the best way to deal with it. My app has 3 buttons. Each button requests a different XML file from a server which is used to populate a table view. If I rapidly press the buttons in sequence , button 1 button 2 button3 button 1 button 2 button3 button 1 button 2 button3 the application quits. What could be causing this. Would id be in the NSURLRequest side of things or the table view population side? How would you suggest I stop this behaviour? I was going to just set a boolean "isRequesting" to true when a button is pressed and set it to false when the table view is finished populating. If any button is pressed while isRequesting is True they do nothing. Does that sound wise or is there a better way? Thanks, dub

    Read the article

  • No exception, no error, still i dont recieve the json object from my http post

    - by user2978538
    My source code: final Thread t = new Thread() { public void run() { Looper.prepare(); HttpClient client = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(client.getParams(), 10000); HttpResponse response; JSONObject obj = new JSONObject(); try { HttpPost post = new HttpPost("http://pc.dyndns-office.com/mobile.asp"); obj.put("Model", ReadIn1); obj.put("Product", ReadIn2); obj.put("Manufacturer", ReadIn3); obj.put("RELEASE", ReadIn4); obj.put("SERIAL", ReadIn5); obj.put("ID", ReadIn6); obj.put("ANDROID_ID", ReadIn7); obj.put("Language", ReadIn8); obj.put("BOARD", ReadIn9); obj.put("BOOTLOADER", ReadIn10); obj.put("BRAND", ReadIn11); obj.put("CPU_API", ReadIn12); obj.put("DISPLAY", ReadIn13); obj.put("FINGERPRINT", ReadIn14); obj.put("HARDWARE", ReadIn15); obj.put("UUID", ReadIn16); StringEntity se = new StringEntity(obj.toString()); se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); post.setEntity(se); post.setHeader("host", "http://pc.dyndns-office.com/mobile.asp"); response = client.execute(post); if (response != null) { InputStream in = response.getEntity().getContent(); } } catch (Exception e) { e.printStackTrace(); } Looper.loop(); } }; t.start(); } } i want to send an Json object to a Website. As far as I can see, I set the header, but still I get this exception, can someone help me? (I'm using Android-Studio) __ Edit: i don't get any exceptions anymore, but still i do not receive the json packet. When i manually call the website i get a log file entry. Does anyone know, what's wrong? Edit2: When i debug i get as response "HTTP/1.1 400 bad request" i'm sure its not an permission problem. Any ideas?

    Read the article

  • obj-c : iphone programming NSTimeInterval problem

    - by the1nz4ne
    hi, i got a problem with my time interval. I need to get the interval of two times in this format : HH:MM. If i enter : 15:35 and 16:35 it is ok, but when i do 20:30 to 01:30, it gives me like 18 hours interval.. anyone have an idea? NSString *startDate= starthere.text; NSString *endDate = endhere.text; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"HH:mm"]; NSDate *dateSelected = [dateFormatter dateFromString:startDate]; NSDate *dateSelected2 = [dateFormatter dateFromString:endDate]; [dateFormatter release]; interval = [dateSelected2 timeIntervalSinceDate:dateSelected];

    Read the article

  • Call a function from another Class - Obj C

    - by AndrewDK
    I'm trying to figure out how I can call a function from another one of my classes. I'm using a RootViewController to setup one of my views as lets say AnotherViewController So in my AnotherViewController im going to add in on the .h file @class RootViewController And in the .m file im going to import the View #import "RootViewController.h" I have a function called: -(void)toggleView { //do something } And then in my AnotherViewController I have a button assigned out as: -(void)buttonAction { //} In the buttonAction I would like to be able to call the function toggleView in my RootViewController. Can someone clarify on how I do this. I've tried adding this is my buttonAction: RootViewController * returnRootObject = [[RootViewController alloc] init]; [returnRootObject toggleView]; But I dont think that's right. Thanks in advanced.

    Read the article

  • Operator Overloading in C++ as int + obj

    - by Azher
    Hi Guys, I have following class:- class myclass { size_t st; myclass(size_t pst) { st=pst; } operator int() { return (int)st; } int operator+(int intojb) { return int(st) + intobj; } }; this works fine as long as I use it like this:- char* src="This is test string"; int i= myclass(strlen(src)) + 100; but I am unable to do this:- int i= 100+ myclass(strlen(src)); Any idea, how can I achieve this?? Thanks in advance. Regards,

    Read the article

  • Obj-C: Passing pointers to initialized classes in other classes

    - by FnGreg7
    Hey all. I initialized a class in my singleton called DataModel. Now, from my UIViewController, when I click a button, I have a method that is trying to access that class so that I may add an object to one of its dictionaries. My get/set method passes back the pointer to the class from my singleton, but when I am back in my UIViewController, the class passed back doesn't respond to methods. It's like it's just not there. I think it has something to do with the difference in passing pointers around classes or something. I even tried using the copy method to throw a copy back, but no luck. UIViewController: ApplicationSingleton *applicationSingleton = [[ApplicationSingleton alloc] init]; DataModel *dataModel = [applicationSingleton getDataModel]; [dataModel retrieveDataCategory:dataCategory]; Singleton: ApplicationSingleton *m_instance; DataModel *m_dataModel; - (id) init { NSLog(@"ApplicationSingleton.m initialized."); self = [super init]; if(self != nil) { if(m_instance != nil) { return m_instance; } NSLog(@"Initializing the application singleton."); m_instance = self; m_dataModel = [[DataModel alloc] init]; } NSLog(@"ApplicationSingleton init method returning."); return m_instance; } -(DataModel *)getDataModel { DataModel *dataModel_COPY = [m_dataModel copy]; return dataModel_COPY; } For the getDataModel method, I also tried this: -(DataModel *)getDataModel { return m_dataModel; } In my DataModel retrieveDataCategory method, I couldn't get anything to work. I even just tried putting a NSLog in there but it never would come onto the console. Any ideas?

    Read the article

  • Contrary to Python 3.1 Docs, hash(obj) != id(obj). So which is correct?

    - by Don O'Donnell
    The following is from the Python v3.1.2 documentation: From The Python Language Reference Section 3.3.1 Basic Customization: object.__hash__(self) ... User-defined classes have __eq__() and __hash__() methods by default; with them, all objects compare unequal (except with themselves) and x.__hash__() returns id(x). From The Glossary: hashable ... Objects which are instances of user-defined classes are hashable by default; they all compare unequal, and their hash value is their id(). This is true up through version 2.6.5: Python 2.6.5 (r265:79096, Mar 19 2010 21:48:26) ... ... >>> class C(object): pass ... >>> c = C() >>> id(c) 11335856 >>> hash(c) 11335856 But in version 3.1.2: Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) ... ... >>> class C: pass ... >>> c = C() >>> id(c) 11893680 >>> hash(c) 743355 So which is it? Should I report a documentation bug or a program bug? And if it's a documentation bug, and the default hash() value for a user class instance is no longer the same as the id() value, then it would be interesting to know what it is or how it is calculated, and why it was changed in version 3.

    Read the article

  • iPhone/Obj-C - Archiving object causes lag

    - by Dylan
    Hi I have a table view, and when I delete a cell I am removing an item from an NSMutableArray, archiving that array, and removing the cell. However, when I do this, it is causing the delete button to lag after I click it. Is there any way to fix this? // Override to support editing the table view. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { int row = [indexPath row]; [savedGames removeObjectAtIndex:row]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; //this line causing lag [NSKeyedArchiver archiveRootObject:savedGames toFile:[self dataFilePath]]; } } Thanks

    Read the article

  • NUNIT + VS2010 = Unable to copy file from /obj to /bin...being used by another process

    - by TimDog
    I am trying to run some unit tests using NUnit while I have the project open, and VS 2010 cannot rebuild the project while the assembly is loaded in NUnit. I have looked around and haven't found any solutions that seen to fix it. I can close NUnit, then the project builds fine. This is a the same solution based on Rob Conery's BDD demo found here: http://tekpub.com/view/concepts/5 Any thoughts?

    Read the article

  • C++ String tokenisation from 3D .obj files

    - by Ben
    I'm pretty new to C++ and was looking for a good way to pull the data out of this line. A sample line that I might need to tokenise is f 11/65/11 16/70/16 17/69/17 I have a tokenisation method that splits strings into a vector as delimited by a string which may be useful static void Tokenise(const string& str, vector<string>& tokens, const string& delimiters = " ") The only way I can think of doing it is to tokenise with " " as a delimiter, remove the first item from the resulting vector, then tokenise each part by itself. Is there a good way to do this all in one?

    Read the article

  • Search pattern in string using regex in obj-c

    - by manileo86
    I'm working on a string pattern match algorithm. I use NSRegularExpression for finding the matches. For ex: I've to find all words starting with '#' in a string.. Currently I use the following regex function: static NSRegularExpression *_searchTagRegularExpression; static inline NSRegularExpression * SearchTagRegularExpression() { if (!_searchTagRegularExpression) { _searchTagRegularExpression = [[NSRegularExpression alloc] initWithPattern:@"(?<!\\w)#([\\w\\._-]+)? options:NSRegularExpressionCaseInsensitive error:nil]; } return _searchTagRegularExpression; } and I use it as below: NSRegularExpression *regexp = SearchTagRegularExpression(); [regexp enumerateMatchesInString:searchString options:0 range:stringRange usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { // comes here for every match with range }]; This works properly. But i just want to know if this is the best way. suggest if there's any better alternative...

    Read the article

  • Obj-C crashes on substringWithRange message

    - by code_burgar
    The following code is making my app crash at line 3 without an error I would recognize or know how to deal with. Any ideas as to what I am doing wrong? NSInteger *match = [str1 intValue] + [str2 intValue]; NSString *strrep = [NSString stringWithFormat:@"%i", match]; label.text = [strrep substringWithRange:NSMakeRange(1,3)];

    Read the article

  • What object called a method in Obj-C

    - by Loz
    Hi, I am looking to write a plugin controller in Cocoa that loads bundles, and exposes a specific set of methods for the plugins to call. My question is this: is it possible to know (any) info about the object that called a method in the controller. When an instantiated plugin calls a method in my plugin controller, I would like to know which of the plugin instances called the method, without having to rely on the plugin sending a pointer to itself as a parameter (I could always validate the pointer they send, but I want to keep the API methods as simple as possible). There may be no perfect solution (and there are simple workarounds), but it's always good to learn some new tricks if possible (or the reasons why it's impossible). Thanks in advance.

    Read the article

  • simple obj-c naming question

    - by Highstead
    This question is more to figure out how to look up classes and objects in objective-c but i lack the knowledge to figure out how to look this up so i pose the question here. In .Net if i had a MyObject.MyValue the MyValue would be called a property, and I could look this up in MSDN. In java i would check the javadocs online (and that property would have to be a value). With objective-c that is called a ? and if i wanted to look it up i would look where? Example: //Object.??? UIImage.backgroundColor = [UIColor blueColor];

    Read the article

  • How to use the variable declared in one class in another class in Obj C.

    - by srikanth rongali
    I have a NSDate *date1 in class1 implementation file(I initialized it as Global variable). I have NSDate *date2 in class 2 implementation file (initialized it as Global variable). I need to calculate the NSTimeInterval between the two dates in class 2. But I could not do it. I could not access date1 in this class. It is giving error as (date2 undeclared). Please give me help in how to call other class variables in this class. Thank you.

    Read the article

  • Simple Obj-C Memory Management Question

    - by yar
    This is from some sample code from a book // On launch, create a basic window - (void)applicationDidFinishLaunching:(UIApplication *)application { UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[[HelloController alloc] init]]; [window addSubview:nav.view]; [window makeKeyAndVisible]; } But a release is never called for window nor for nav. Release should be called since alloc was called, right? If #1 is right, then I would need to store a reference to each of these in an instance variable in order to release them in the dealloc? Perhaps I'm wrong all around...

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >