Xcode Debugger & Editor questions

The bottom portion of Xcode's debugger show a blank area with the words "No Editor." Am I supposed to choose or supply one?
As it stands, I can see the variables, but no code.
Also, the debugger is not stopping in my "on wake from nib" even though it executes and assigns variables ... perplexed in my first use of the editor.
John

John:
The "No editor" message simply means that the debugger has no code to show. Probably because there is no breakpoint set to stop execution. Set a breakpoint on your sorce code by clicking on the gutter on the left side of an editor window in Xcode. Then select "build and debug". The debugger should stop on your breakpoint and show you the approprite code below.
Good luck.
JP

Similar Messages

  • How do I set up the XCode Debugger so that it does not drop into asm?

    How do I set up the XCode Debugger so that it does not drop into asm?
    I want to step through my Cocoa Objective-C code and I do not want to see the underlying assembly. When I hit step over, I want it to step to my next line of objective-C code, not to the next assembly language statement.
    99+% of the time, I want to do high level debugging. Don't you?

    I solved my own problem almost immediately after I posted it.
    You use Debug>Toggle Disassembly Display.
    It puts a check mark to drop into assembly, no check mark for no assembly (my choice) and a dash (NSMixedState) for both. It's obvious now.
    Sometimes it can be vexing to find simple XCode features quickly.

  • Xcode debugger question

    How do i setup the debugger in xcode?

    The debugger is already setup in Xcode, do you have a specific question?

  • Is it possible to display the content of complex mutlidimensional datastructures (e.g. std::vectors (dim = 2) of (non-primitive) types) in Xcode debugger?

    Hi,
    First, let me say that I like Xcode and coding in OS X. However, there is something I miss:
    Let me demonstrate what i mean:
    This is the representation of a 2D-Vector in Xcode Debugging environment:
    v          'std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >'          [{...}]
    0          'std::vector<int, std::allocator<int> >'          [{...}]
    1          'std::vector<int, std::allocator<int> >'          [{...}]
    2          'std::vector<int, std::allocator<int> >'          [{...}]
    3          'std::vector<int, std::allocator<int> >'          [{...}]
    4          'std::vector<int, std::allocator<int> >'          [{...}]
    5          'std::vector<int, std::allocator<int> >'          [{...}]
    6          'std::vector<int, std::allocator<int> >'          [{...}]
    7          'std::vector<int, std::allocator<int> >'          [{...}]
    8          'std::vector<int, std::allocator<int> >'          [{...}]
    So, the above representation is what I would call bad (even useless).
    The problem is that the current Linux Kernel (3.1.1) has some problems with the new MBA 2011 (which is really sad) so I can not show you the representation of a 2D-Vector in Qt-Creator for Linux right now (I'm not sure if the Qt-Creator for OS X could display the content properly, since I've never tried it). But you can believe me, that the represantation would look something like the one in Eclipse (which would be a good representation).
    So my question: is there a "fix" for this?

    What you want is a custom data formatter. I would give you some links, but my iPad wants to convert them into the documentation viewer.
    You aren't going to find much help with C++ debugging. While Apple's Clang has made great improvements in C++ support compared to GCC, C++ is really not something that Mac or iOS programmers typically use. The Cocoa containers and objects are so much more versatile. You kind of have to have a masochist streak and a 7 year development schedule to use C++. C++ is experiencing a bit of a resurgence, especially in defense markets. For a long time, compilers had such poor support for C++ that it just wasn't possible. After simplifying the language a little, compilers can now compile and link C++. Consultants have realized they can provide C++ services and burn though billable hours better than any other language on the market. Independent developer, however, don't have those schedules and budgets so they tend to use NSArray. Xcode supports it better in the debugg and, chances are, you don't need to debug it anyway. There are a number of matrix classes built on Cocoa.

  • Xcode debugger stops when NOT going through break

    I have some c++ code, very simple:
    195 MyModelItem *parentItem = thisItem->parent();
    196 if(parentItem == NULL)
    197 {
    198 std::cout << "parentItem is NULL\n";
    199 bool parentIsNull = true;
    200 if(parentIsNull)
    201 return QModelIndex();
    202 return QModelIndex();
    203 }
    204 else if((unsigned int)parentItem == 0x4d0000)
    205 {
    206 std::cout << "parentItem is 0x4d0000\n";
    207 return QModelIndex();
    208 }
    209 else if (parentItem == m_root)
    210 return QModelIndex();
    211
    212 return createIndex(parentItem->row(), 0, parentItem);
    213 }
    I put a breakpoint on line 200 -- the one that is inside the if-clause and says:
    bool parentIsNull = true;
    There is a cout right above that line. So the breakpoint should not be triggered except when parentItem is NULL, and the debugger console should have the "parentItem is NULL" message logged to it.
    But, in fact, the breakpoint gets triggered every single solitary time the function gets called. According to the GDB status reported on the debugger console, it claims that it has stopped at "Breakpoint 1" and that it is "Line 200". Line 200 is indeed the line that I put the breakpoint on, but the little red arrow is not on Line 200, it's on Line 204. If I single-step after the breakpoint stops, it goes to line 209, then the red arrow jumps to the "return" statement which is at the end of the previous function in the file, and then finally to line 213 -- which is one line after the actual return statement.
    So does anyone know any way to get the debugger to behave? To only stop when the breakpoint in question actually gets triggered? It would be nice if the single-step behavior followed what code is supposed to be executing, but I would settle for not stopping at "phantom" triggers.

    When I type "clear" at the gdb prompt, I get a "No source file specified" error...
    I'm not sure that I am being clear on my problem here. I have a breakpoint at line 200. Line 200 is inside the if-clause
    if(parentItem==NULL) { ... }
    I want the program to stop at line 200, but only if parentItem==NULL. In my previous experience with every debugger I've used (including many years using gdb) if you set a break on a line of code that only executes if some condition is true, then the breakpoint only gets triggered, and the program only stops, if the condition is true and the line of code that the breakpoint is on executes. What I am seeing is that Xcode wants to stop at the breakpoint if the line is executed, but also stop at the next line which is executed if that line is not executed. I can set the breakpoint to a log-and-continue state, but then it logs and continues when I want it to stop. I tried setting the condition of parentItem==NULL in the edit breakpoint dialog, but then it says "Error in testing breakpoint condition:"
    When I've seen this behavior before it has been related to not getting optimization turned off. (The optimization makes the whole swath of code disappear, and so the debugger just kinds improvises on the line numbers and stops whenever you are in the vicinity.) But I have checked the project settings over and over, and it's set debug, and optimization is set to NONE, and I just can't see anything else to turn on/off to get breakpoints to work.

  • Xcode debugger viewing vector / struct values

    I am using Xcode to develop C++ command line tools. How do I view vector values for something like vector<int> with the debugger?
    Same question for a structure or class, say
    struct data {
    float x;
    float y;
    and then for a vector<data> mydata;
    PowerBook G4    

    You'll have to use the command line and just type in what you want to see. Avoid operator overloads and use conversion methods "c_str()" if needed to get a displayable type.
    In theory, you could also use Xcode's Data Formatters, but in practice, GDB just barely works with C++ to begin with and it may be a waste of time.
    Don't forget your "poor-man" debugging skills - NSLog/stdout/printf.

  • Applecript and xcode. Simple question, unknown answer. help!

    Hello,
    I am completely new to XCode and have been trying to use some self-made applescript libraries for a new Applescrip-xcode app.
    My question is just how to call from my main script (applescrip) the functions inside those libraries. I used to do something like this (and works fine) when using applescript editor:
    set library_file to "pathtolibFolder:myLibrary.scpt"
    set myLibrary to (load script file (library_file))
    set aVariable to aFunction() of myLibrary
    This code (I think obviously) does not work in xcode, and I think there should be somewhere something like:
    #include "myLibrary.scpt"
    Those self-made-libraries are already compiled and have been imported (non .applescript but .scpt), de-compiled and re-compiled by xcode correctly (no errors), but I don't know where I have to put the connections to those libraries in my project. I'm sure the answer is simple but I'm unable to find it by myself.
    Thanks!
    Message was edited by: rampol

    Replying myself... I think I've found the answer, not yet tried but looks nice. I post (paste) it here cos it might be useful to someone. I'll let you know if that works:
    How could I include an applescript as its own ASOC class?
    It's pretty straightforward. In XCode, Make a new file ... class... ASOC.
    And you can basically paste in your applescript into the middle of the file that is created. Make sure that you change the names of any handlers you want to call from outside the class into ASOC methods by adding an underscore between name and parentheses; i.e. from doThething() to doTheThing_()
    A typical applescript handler:
    property aProperty : "a string"
    global aGlobal
    on doTheThing(withThis)
    return retVal
    end doTheThing
    as its own ASOC class:
    script aScriptClassName
    property parent : class "NSObject"
    property aProperty : "a string"
    global aGlobal
    on doTheThing_(withThis)
    return retVal
    end doTheThing_
    end script
    Then, to call the methods in your new ASOC class from another ASOC class, the easiest thing to do is add your new class to your application's Interface Builder NIB and connect it to a property in the ASOC class you want to call your methods from.
    property myOtherClass : missing value
    myOtherClass's doTheThing_(itsInput)
    -------------------------------------------------

  • Collaborating with Editors question

    Hi,
    I did a complete book layout in InDesign.
    The publisher now says he is not happy with the editing (my side of
    things -- the design work -- is fine) and he wants the entire book to go
    through another round of editing.
    The book has already been through several rounds of proofreading (ie
    checking the PDF for mistakes and keying these changes into InDesign),
    and they don't want to lose that work. What this means is that I, as
    typesetter, am the only one who has the very latest version of the text.
    As there are going to be extensive changes (I'm not sure what) and the
    publisher wants to work off the latest version, he wants me to export
    all the text as a Word file and then the editors will work on that.
    However, the publisher is aware that in such a case I'll have to redo
    the layout, and he wants to avoid that extra expense, so he asked me if
    there is any way that the editors can work on the text without my having
    to redo the layout.
    My immediate thought was InCopy (which I've never used, only heard
    about) -- the publisher could use the 30-day trial (at this stage,
    obviously if they like it they may purchase the thing). But
    (1) I'm on CS4 and the downloads of InCopy are all CS5.5. That won't
    work together, right?
    (2) Can I get hold of InCopy CS4 anywhere?
    (3) Is the learning curve (both for me and the editor) going to be too
    steep to do this in 30 days?
    (4) Are the editors going to mess up my styles? I mean, if they need
    some italics, how will they know to use my italics char style? And if
    they need a subtitle paragraph style, how will they know to use that? If
    I'm going to have to go through the entire book figuring out what
    they've meddled with, I think it will be more trouble than it's worth
    and I'd rather use the Word workflow.
    Thanks for any advice,
    Ariel

    I think a lot would depend on how complicated the design of this book is. If there's a lot of formatting, dozens or hundreds of character and paragraph styles, etc., that's probably not something you're keen to re-do.
    However, InCopy does have a bit of a learning curve for editors who are used to using Word. The learning curve for you shouldn't be too steep -- you'll need to learn how to create InCopy stories and export them so they'd editable by the editors, but otherwise InCopy is basically just the text editing features of InDesign, with a few extra writing tools (such as the thesaurus) thrown in. As the designer, you'll hardly ever use InCopy, if at all, but you can probably answer most questions for a new InCopy user as most editing elements are the same in both programs.
    There are other things to consider too - if the editors don't have the fonts installed, they aren't going to see accurate line breaks or copyfit, and may do damage attempting to "fix" something that isn't really wrong. And as you noted, it would probably be best to provide a spec sheet showing what styles to apply where.
    InCopy is a great tool, and in the hands of editors who have been trained and who have adequate support, it can save a lot of time on a project, particularly if it's planned for upfront. But I think that training needs to happen as the project is starting up, not at the stage you're currently in. Perhaps they could stick with the PDF mark-ups and send you patch files in Word for any sections that need signficiant changes.
    BTW, you might want to post your question over in the main InDesign forum if you haven't already. I'm sure you'll find other InCopy users there, or others who have faced the same kind of dilemma. The main forum tends to get more traffic than the scripting one does, and you'll reach a broader range of users there.
    Good luck!

  • DNG Profile Editor - questions about

    0) Thank to Eric Chan for your work on this. Until now I used the Camera Calibration process through Photoshop and Camera Calibration table. But I see this as a big progress.
    1) Will it stay only DNG editor or it will be also for raw pictures without a necessity to convert them to dng?
    2) Will it be only stand alone aplication or as well a part of the LR?
    3) Now I can switched off and on one color change (by the left mark in the Color List Box). Could it be possible to switch off and on the whole Color List Box to see all done changes?
    4) I have red your comment that this tool doesn't work with lightness, only hue and saturation. But if I want to work on a specific picture (i.e. a man wearing a red sweater), it will be fine to have it in the brightness close to an end picture. Will it be possible to open a picture not only with WB, but also with exposure, blacks and other basic development setting?
    5) Under the eye drop tool, I can see numbers of "initial" or "starting" color. But I can't see the numbers of changed color. It would be fine if I know the new numbers to see how close I am to them. It would be fine if the number over the color List Box will be also for starting color and also for end colors.
    And one little proposal: if the color will not change, show in Color List Box only the starting (left) half of a color. Than I can simply see that I didn't set a new color or the color stay exactly the same (it is only a question if exactly the same or very close to the same).
    6) It could be, that I will not use the exact color checker table for what you did process on the tab Chart. But many of color checker are delivered with exact numbers and picture on a cd, so it will be fine if I could open this "master" picture of a checker producer in a right panel under the Color List Box and simply take from it the end colors. First go to the main picture on left, choose the "initial color" and then simply go to this "master" picture in right and take the "end color". What do you think about this?
    7) If I work on the tab Chart, I get the error window "not neutral gray patches, row 4 culumn 1". But if I move the circle to row 4 culumn 2 it works fine. Is there any difference or problem?
    8) And last: how far is acting the shift of color. It will not work only for the one color but close surroundings will be also efeccted. How smal or large is the surroundings? E.g. if we take 360 degres for hue.
    Tom

    1. For now DNG-only. Here's why:
    http://labs.adobe.com/wiki/index.php/DNG_Profiles_FAQ#PEOnlyDNG
    http://labs.adobe.com/wiki/index.php/DNG_Profiles_FAQ#WhyNameDNGPE
    http://labs.adobe.com/wiki/index.php/DNG_Profiles_FAQ#WhyPESeparate
    2. Standalone for now. See above links for why.
    3. Use the 'Preview Color Changes' option in the Options menu.
    4. You can use 'Apply Raw Adjustments' in the Options menu to see your raw adjustments. This is __not__ recommended for building a general-purpose profile because you are then optimizing a profile with specific image adjustments in mind, rather than building a profile based more on the inherent camera characteristics.
    5. True, that is a limitation of this implementation.
    6. I am not sure what you mean. The Chart Wizard automatically optimizes the color patches in a test shot based on reference values for many physical charts, which is more practically useful than the numbers printed on the reference card that comes with the chart.
    7. Make sure you avoid color casts in the bottom row. The PE is picky about making sure your gray patches are relatively neutral. It is an attempt to help you get a better profile.
    8. Use 'Show Affected Colors' from the Options menu.
    You may wish to read this page carefully and thoroughly:
    documentation
    It is the reference online documentation for the DNG Profile Editor and a few of the things you wish to do, such as preview all color changes, apply raw adjustments, and visualize the extent of each color adjustment, are all documented there.

  • Xcode debugger not showing my instance variables!!

    I hate asking questions like this.
    I set a breakpoint in an IBAction method 'pushed:' inside FooViewController.  At runtime I pressed a GUI button and processing stopped in pushed:.
    In the data-viewing pane of xcode, I see
    {code}
    self = (FooViewController *) 0x... etc.
    {code}
    Indented under this is
    {code}
    UIViewController = (UIViewController) { ...
    {code}
    Nowhere do I see any of my instance variables!!
    Now, they were synthesized from properties, but that doesn't matter, does it?
    The code that proceeds to set some instance variables runs fine.
    Why isn't xcode displaying self's instance vars?
    Thanks,
    Chap

    Yes, yours looks like I was expecting mine to look.
    Note that viewDidLoad (below) does work correctly, producing the expected results in the simulator!
    Hangman3ViewController.h:
    @interface Hangman3ViewController : UIViewController {
    @property (         nonatomic )           NSInteger  wordLength;
    @property ( retain, nonatomic )           NSString  *alphabet;
    @property (         nonatomic )           unichar    guess;
    @property (         nonatomic )           NSInteger  guessNo;
    @property ( retain, nonatomic )           NSMutableString *board;
    @property ( retain, nonatomic ) IBOutlet  UILabel   *boardLabel;
    @property ( retain, nonatomic ) IBOutlet  UILabel   *guessNumberLabel;
    @property ( retain, nonatomic ) IBOutlet  NSArray   *keyboardButtons;
    - (IBAction)letter:(id)sender;
    - (void)showBoard;
    @end
    and, Hangman3ViewController.m:
    #import "Hangman3ViewController.h"
    @implementation Hangman3ViewController
    @synthesize wordLength       = _wordLength;  // preprocessor command to gen getter/setter and instance variable
    @synthesize boardLabel       = _boardLabel;  // preprocessor command to gen getter/setter and instance variable
    @synthesize guessNumberLabel = _guessNumberLabel;  // Guess #n
    @synthesize keyboardButtons  = _keyboardButtons;   // array of buttons
    @synthesize alphabet         = _alphabet;    // A-Z unichars
    @synthesize guess            = _guess;       // unichar
    @synthesize guessNo          = _guessNo;     // int
    @synthesize board            = _board;
    - (IBAction)letter:(id)sender
                Get letter from sender - driven when key button is pressed.
                The button's tag is an int from 0-25, identifying what letter of the alphabet it is.
                Extract that unichar from ALPHABET as 'guess'.  Then, disable the button,
                which has been defined to have its text turn white (invisible) when disabled.
        UIButton *button = (UIButton *)sender;
        self.guess = [self.alphabet characterAtIndex: button.tag];
        NSLog(@"Received keystroke: %C", self.guess);
        [button setEnabled:NO];
    - (void)showBoard
        self.boardLabel.text = self.board;
        self.guessNumberLabel.text = [NSString stringWithFormat:@"Guess #%d", self.guessNo];
    - (void)dealloc
        [_boardLabel release];
        [_guessNumberLabel release];
        [_keyboardButtons release];
        [super dealloc];
    - (void)didReceiveMemoryWarning
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];
        // Release any cached data, images, etc that aren't in use.
    #pragma mark - View lifecycle
    // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad
        NSLog(@"Hello from viewDidLoad");
        [super viewDidLoad];
        self.alphabet   = @"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // unichar string
        self.wordLength = 7;  // temp - will be set from flipside later on
        self.guessNo    = 1;
        [self.board setString:@"_______"]; // actually dynamic based on wordLength
        self.board = @"_______";
        [self showBoard];
    - (void)viewDidUnload
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    @end

  • Studio Creator 2: Query Editor questions

    Having trouble figuring out the Query Editor... 'Help' says there should be four sections; I see two: the SQL and grid results run a test from a Sybase table... I can't select the grid column and specify WHERE clause stuff... also it doesn't seem to let me Save the Query... not sure what's wrong... Any ideas on either question? Thanks

    It could be that an Output Window (the Window at the bottom center)
    is obscuring the view.
    There are a couple of ways of specifying a where clause
    1) Add a constraint - inside the grid view, scroll to the Criteria column, right-click
    and choose Add Criteria
    2) In the text editing pane, just type in the where clause.
    Note: the Query Editor's parser accepts a basic set of SQL syntax keywords.
    If a keyword is not recognized then the graphical view and grid view clear.
    The Run Query feature will still be available.
    This is something we hope to improve.
    Here's some more resources on the Query Editor:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/query-editor.html
    http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/2/queryeditor.html
    John
    Creator team

  • IPhone proejct: XCode debugger will not stop on breakpoints

    I've got XCode 3.1.2 on OS X 10.5.5. I have an iPhone project that builds fine but the debugger will not hit any of the breakpoints I set. I've tried all the standard fixes that I find on the net:
    1. I've turned off 'Load Symbols Lazily' in XCode preferences
    2. My active config is Debug
    3. Optimization level is 0 in build settings
    4. I've cleaned all targets and rebuilt
    5. I use Build and Debug (as opposed to Build and Run)
    I thought I might have inadvertently tweaked settings on my project. So I created a new project and that one has the same problem.
    I'm hoping that I am missing something easy here. My debugger was working just a few days back but all of a sudden it has stopped.
    Thanjs in advance

    Occasionally I run into this problem, and it is still a mystery to me.. however, if I put a break in the appDidFinishLoading, or some other very early method, it always seems to work, and then the other breakpoints work too! I wish I understood why.
    michael

  • IPhone: XCode debugger blank....

    My debugger window in just one of my iPhone projects is now completely blank! It has a toolbar at top, and the statusbar along the bottom, and the content area is just blank gray. My other projects work fine. Any ideas? I tried looking around to see if it was one of the views just expanded to fill up the entire window but that doesn't seem to be the case.
    Is there a way to reset the debugger back to factory settings?

    Finally figured out how to do this. Open up the xcodeproj package and look for the "mode1v3" file. That is an xml file that holds all of the window layout info. Search for the block for the debugger (just use "debugger") and delete that. Then relaunch Xcode.

  • Xcode template comment Question

    Hi,
    I've made a few template wich import the framework I currently use and place them into Xcode.
    When I create a new project I can see them where I want them (that's cool).
    The only thing I miss is when I click on one of my template there is no info for them.
    Where can I add this info?
    So I can write a note to myself of what exactly is in that template.
    For now I use abreviation into the name but that technique as it's limite.
    Thanks

    I'm a little confused by the phrasing of your question. You have created an Xcode project template. When you create a new project in Xcode and select your template from the list of project templates, you want a description of your template to appear in the text field under the list of project templates. Am I correct in figuring out what you want?
    If I am correct, you need to modify the TemplateInfo.plist file that resides inside the Xcode project file's bundle. Change the Description field to what you want to see when you select the project from the list of project templates. For more detailed information, go to the following URL and read the tip Adding Descriptions to Your Project Templates:
    http://www.meandmark.com/xcodetips.html
    Message was edited by: Mark Szymczyk
    Message was edited by: Mark Szymczyk

  • Processing Rule Editor question

    Hi Everyone,
    Hopefully I didn't miss a solution to this problem when I was searching the forums.  Anyways I was wondering how I can create some sort of regular expression in the Processing Rule Editor's "Message Name" field to catch and categorize all messages with the same prefix in their name.
    For example, all of my test messages have some prefix followed by the date and time of their entry into the system as their Message Names to uniquely identify them.  Let's say I'd like all my messages prefixed with "MSG" to be categorized by some rule.  When creating the rule I would expect to be able to place a regular expression such as "MSG*" in the "Message Name" field in order to have the rule catch all messages who's name starts with "MSG" and categorize them but this is not the case.
    If anyone knows how to do this could you please help me with the expression's syntax?

    Christopher,
    I guess you are now using the XMIIMESSAGELISTENER explained in your last post. You have to select a unique name in the processing rule, entering a regular expression will not work.
    As a solution to this, define a rule with a fixed name that calls a transaction. Inside the transaction you can define the logic to process only messages that fulfil certain criteria from values inside your message.
    Michael

Maybe you are looking for