Search Results

Search found 418 results on 17 pages for 'ib'.

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

  • iPhone Orientation Relayout From Single Column to Double Column

    - by kkrizka
    I am trying to create a UIView in Interface Builder that shows to the user two boxes containing some text. This UIView should support both landscape and portrait modes. When in portrait orientation, the two boxes should be centered horizontally and be under each other. Like in the picture below: But when in landscape orientation, it should show the two boxes centered vertically and by side by side. Like in the picture below: Is this possible using only the autosizing options (or any other IB options), or do I have to relayout the view in code on orientation change events? I would prefer using only IB. I tried locking the top and left margins of the top box and locking the bottom and right margins of the bottom box. But the problem is that for it to work I also need to shrink the two boxes as one changes from portrait to landscape, because otherwise they would overlap.

    Read the article

  • Change the null placeholder in a Cocoa binding?

    - by Monolo
    Is there a way to change (for the purpose of localization) the null placeholder in a binding in Cocoa? The bindings are set up in Interface Builder for a popup button. The two-way nature of the bindings as set up in IB is needed, so doing it programmatically is not really appealing. I am aware that the standard way of handling localizations of a nib file is by making one for each language, but since this is the only difference in the whole nib file between the language versions, it seems a bit excessive for a single string. If there is a way to modify a binding created in IB, I was thinning about doing it in the file's owner's awakeFromNib method.

    Read the article

  • Saving Interface Builder Changes when building in Xcode

    - by Tony Eichelberger
    I know many of you have experienced the same the scenario, where you are banging your head against the wall wondering what is wrong with your app only to find that you have forgotten to save your Interface Builder changes. Well, this never happens to me, because for some reason Xcode will prompt me to save any changes in Interface Builder whenever I build. A coworker and I are trying to figure out how to change this on his machine, with no success. I must have done something in the very early stages of my iphone development life to configure this. Does anyone know how to link IB with Xcode so that it will prompt to save changes to IB files during a build?

    Read the article

  • iPhone: didSelectRowAtIndexPath not invoked

    - by soletan
    Hi, I know this issue being mentioned before, but resolutions there didn't apply. I'm having a UINavigationController with an embedded UITableViewController set up using IB. In IB the UITableView's delegate and dataSource are both set to my derivation of UITableViewController. This class has been added using XCode's templates for UITableViewController classes. There is no custom UITableViewCell and the table view is using default plain style with single title, only. Well, in simulator the list is rendered properly, with two elements provided by dataSource, so dataSource is linked properly. If I remove the outlet link for dataSource in IB, an empty table is rendered instead. As soon as I tap on one of these two items, it is flashing blue and the GDB encounters interruption in __forwarding__ in scope of a UITableView::_selectRowAtIndexPath. It's not reaching breakpoint set in my non-empty method didSelectRowIndexPath. I checked the arguments and method's name to exclude typos resulting in different selector. I recently didn't succeed in whether delegate is set properly, but as it is set equivalently to dataSource which is getting two elements from the same class, I expect it to be set properly. So, what's wrong? I'm running iPhone/iPad SDK 3.1.2 ... but tried with iPhone SDK 3.1 in simulator as well. EDIT: This is the code of my UITableViewController derivation: #import "LocalBrowserListController.h" #import "InstrumentDescriptor.h" @implementation LocalBrowserListController - (void)viewDidLoad { [super viewDidLoad]; [self listLocalInstruments]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)viewDidUnload { [super viewDidUnload]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [entries count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; if ( ( [entries count] > 0 ) && ( [indexPath length] > 0 ) ) cell.textLabel.text = [[[entries objectAtIndex:[indexPath indexAtPosition:[indexPath length] - 1]] label] retain]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if ( ( [entries count] > 0 ) && ( [indexPath length] > 0 ) ) { ... } } - (void)dealloc { [super dealloc]; } - (void) listLocalInstruments { NSMutableArray *result = [NSMutableArray arrayWithCapacity:10]; [result addObject:[InstrumentDescriptor descriptorOn:[[NSBundle mainBundle] pathForResource:@"example" ofType:@"idl"] withLabel:@"Default 1"]]; [result addObject:[InstrumentDescriptor descriptorOn:[[NSBundle mainBundle] pathForResource:@"example" ofType:@"xml"] withLabel:@"Default 2"]]; [entries release]; entries = [[NSArray alloc] initWithArray:result]; } @end

    Read the article

  • Window 'onscreen' size puzzle

    - by Bender
    Okay, a REALLY fundamental question about window sizes here... If I create an NSWindow in IB, set its size to 216 x 144 points (exactly 3 inches by 2 inches) then print the window, it measures exactly what I set it to in IB. However, the onscreen display size measures approximately 156 x 105 points. What causes this, and is there any way to force the window to display at the required size onscreen? I ultimately want to draw to this (semi-transparent) window then use it as a full-sized overlay for comparison against a separately loaded scanned image of known size.

    Read the article

  • convert pointer to pointer to void pointer

    - by FihopZz
    When I'm learning to use qsort to sort an array of string, there is a question puzzled me. For example, to sort the following s char *s[] = { "Amit", "Garima", "Gaurav", "Vaibhav" }; To use the qsort, you must provide a comparison function like the following function cstring_cmp I guess in the qsort function, the type of parameter to be passed to the function cstring_cmp is char**. How to convert a char** to a void*? Why can we convert a char** to a void*? int cstring_cmp(const void *a, const void *b) { const char **ia = (const char **)a; const char **ib = (const char **)b; return -strcasecmp(*ia, *ib); /* return the negative of the normal comparison */ }

    Read the article

  • Interface Builder error: IBXMLDecoder: The value for key is too large to fit into a 32 bit integer

    - by stdout
    I'm working with Robert Payne's fork of PSMTabBarControl that works with IB 3.2 (thanks BTW Robert!): http://codaset.com/robertjpayne/psmtabbarcontrol/. The demo application works fine on 64-bit systems, but when I try to open the XIB file in Interface Builder on a 32-bit system I get: IBXMLDecoder: The value (4654500848) for key (myTrackingRectTag) is too large to fit into a 32 bit integer Building the app as 32 bit works, but then running it gives: PSMTabBarControlDemo[9073:80f] * -[NSKeyedUnarchiver decodeInt32ForKey:]: value (4654500848) for key (myTrackingRectTag) too large to fit in 32-bit integer Not sure if this is a generic IB issue that can occur when moving between 64 and 32 bit systems, or if this is a more specific issue with this code. Has anyone else run into this?

    Read the article

  • How do I edit an interface builder object programmatically?

    - by Evelyn
    I created a label using Interface Builder, and now I want to set the background color of the label using code instead of IB's color picker. (I want to do this so that I can define the color using RGB and eventually change the colorspace for the label.) I'm in cocoa. How do I edit the attributes of an IB object using code? My code looks like this: //.h file #import <UIKit/UIKit.h> @interface IBAppDelegate : NSObject { UILabel *label; } @property (nonatomic, retain) IBOutlet UILabel *label; @end //.m file #import "IBAppDelegate.h" @implementation IBAppDelegate @synthesize label; (memory stuff...) @end

    Read the article

  • Loading an OverlayView from XIB -vs- programmatically for use with UIImagePickerController

    - by PLG
    I am currently making a camera app for iPhone and I have a strange phenomenon that I can't figure out. I would appreciate some help understanding. When recreating an overlay view for passing to UIImagePickerController, I have been successfully been able to create the view programmatically. What I haven't been able to do is create the view with/without controller in IB, load it and pass it to the overlay pointer successfully. If I do it via IB, the view is not opaque and obscures the view of the camera completely. I can not figure out why. I was thinking that the normal view pointer might be assigned when loading from XIB and therefore overwrite the camera's view, but I have an example programmatically where view and overlayView are set equal in the controller class. Perhaps the load order is overwriting a pointer? Help would be appreciated... kind regards.

    Read the article

  • iPhone application lifecycle

    - by iter
    InterfaceBuilder generates this method for me in fooAppDelegate.m: - (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after app launch [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; } IB also puts UIWindow *window; in fooAppDelegate.h and @synthesize window; in fooAppDelegate.m, and correspondingly for navigationController. IB generates code to release window and navigationController in dealloc. I cannot see any code that allocates and initializes the window and the navigationController. I wonder where that happens. Ari.

    Read the article

  • Adding NavigationControl to a TabBar Application containing UITableViews

    - by kungfuslippers
    Hi, I'm new to iPhone dev and wanted to get advice on the general design pattern / guide for putting a certain kind of app together. I'm trying to build a TabBar type application. One of the tabs needs to display a TableView and selecting a cell from within the table view will do something else - maybe show another table view or a web page. I need a Navigation Bar to be able to take me back from the table view/web page. The approach I've taken so far is to: Create an app based around UITabBarController as the rootcontroller i.e. @interface MyAppDelegate : NSObject <UIApplicationDelegate> { IBOutlet UIWindow *window; IBOutlet UITabBarController *rootController; } Create a load of UIViewController derived classes and associated NIBs and wire everything up in IB so when I run the app I get the basic tabs working. I then take the UIViewController derived class and modify it to the following: @interface MyViewController : UIViewController<UITableViewDataSource, UITableViewDelegate> { } and I add the delegate methods to the implementation of MyViewController - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 2; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } if (indexPath.row == 0) { cell.textLabel.text = @"Mummy"; } else { cell.textLabel.text = @"Daddy"; } return cell; } Go back to IB , open MyViewController.xib and drop a UITableView onto it. Set the Files Owner to be MyViewController and then set the delegate and datasource of the UITableView to be MyViewController. If I run the app now, I get the table view appearing with mummy and daddy working nicely. So far so good. The question is how do I go about incorporating a Navigation Bar into my current code for when I implement: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath() { // get row selected NSUInteger row = [indexPath row]; if (row == 0) { // Show another table } else if (row == 1) { // Show a web view } } Do I drop a NavigationBar UI control onto MyControllerView.xib ? Should I create it programmatically? Should I be using a UINavigationController somewhere ? I've tried dropping a NavigationBar onto my MyControllerView.xib in IB but its not shown when I run the app, only the TableView is displayed.

    Read the article

  • UITableView setting standalone delegate object?

    - by fuzzygoat
    Hi have setup a sample application using a UITableView. Initially I did this by conforming my controller to and , added a tableView in IB and connected "datasource" & "delegate" to Files Owner. It all works so thats good. What I have been trying out is creating my own class for the delegate. I created a new class and added and , but quickly found I could not connect the tableViewdataSource / delegate. To solve this I added an "Object" (NSObject) in IB and set it to my new class. I then connected the dataSource and delegate outlets to this object. It sort of works, the app runs and displays the tableView, but when I try and scroll the table the app crashes. Can I ask if I am going about this the right way? gary

    Read the article

  • NSString sizeWithAttributes: Inaccuracy

    - by dave-gennel
    I want to know the width of an NSString displayed on the screen in pixels. So I can fit an NSTextField its bounds to be exactly the length of the string itself. So I used IB's "Label" NSTextField and for those who don't know what I mean, I got a label with title "Label", font "Lucida Grande 13px", not selectable, not editable, regular size, no background and according to IB its width is 38px wide. If I want to get its width programatically I use [@"Label" sizeWithAttributes: [NSDictionary dictionaryWithObject: [NSFont fontWithName: @"Lucida Grande" size: 13] forKey: NSFontAttributeName]].width Which will give me 33.293457 . So that's about 5 px of the real width..

    Read the article

  • How to extract delegates from ViewController class?

    - by adranle
    Hi I have the problem that my view controller class has too many delegates and starts to get big. I want to write the delegates in separate classes to keep the view controller class small. For delegates that are programmatically created (like UIAlertViewDelegate) I could do it easily. The problem is in the delegates assigned in Interface Builder. How can I tell the IB to assign, for example, another class as the UITableViewDelegate or UITableViewDataSource? Or how to choose another IBAction method for a Touch UP inside Event on a button? One solution would be to delete the connections from IB and write them programmatically at ViewDidLoad, but since I have a lot of ViewControllers, this would take a long time. any other ideas?

    Read the article

  • SQL Server query problem

    - by user335160
    I want to achieved the results shown in the attached image. The Table Structure and Data are the ffg below: Table Relationship Overall IB Limit->one to many-> Facility Limit Facility Limit->one to many-> Facility Sub Limit Tables Structure and Data Overall IB Limit Id SCAF Reference Approval Date 1 NEW-001 January 1, 2011 2 NEW-002 January 2, 2011 3 NEW-003 January 3, 2011 ---------------------------- Facility Limit Id OverallIBLimitId Product Type 1 1 RPA 2 1 CG 3 2 RPA 4 3 CG ---------------------------- Facility Sub Limit Id FacilityLimitId Sub-Limit Type Amount Tenor Status Status Date 1 1 RPA at max 2,000,0000.00 2 months Approved January 5, 2011 2 1 Oil 3,000,0000.00 3 yrs Approved January 5, 2011 3 2 CG at minor 4,000,0000.00 1 yr Approved January 5, 2011 4 2 CG at max 5,000,0000.00 6 months Approved January 5, 2011 5 2 Flood Component 1 5,000,0000.00 6 months Approved January 5, 2011 6 2 Flood Component 2 6,000,0000.00 3 yrs Approved January 5, 2011 7 3 RPA at minor 1,000,0000.00 6 months Approved January 5, 2011 8 4 One-Off 1,000,0000.00 6 months Approved January 5, 2011

    Read the article

  • NSArrayController that is sorted and unique (no duplicates) for use in a pop-up in a core-data app

    - by Douglas Weaver
    I have core data app with an entity OBSERVATION that has as one of its attributes DEALNAME. I want to reference through Interface Builder or by making custom modifications to an NSArrayController a list of unique sorted dealnames so that I can use them in a pop-up. I have attempted to use @distinctUnionOfSets (and @distinctUnionOfArrays) but am unable to locate the proper key sequence. I can sort the ArrayController by providing a sort descriptor, but do not know how to eliminate duplicates. Are the @distinct... keys the right methodology? It would seem to provide the easiest way to optimize the use of IB. Is there a predicate form for removing duplicates? Or do I need to use my custom controller to extract an NSSet of the specific dealnames, put them back in an array and sort it and reference the custom array from IB? Any help would be appreciated. I am astounded that other have not tried to create a sorted-unique pop-up in tableviews.

    Read the article

  • How to best share an NSMenu between multiple NSPopUpButton instances

    - by Frank R.
    Hi, I need to share the same NSMenu instance between multiple popup buttons. When I create an NSPopUpButton in IB, a new menu is automatically created and inserted as a child of the NSPopUpButtonCell. At the moment, I simply create an IBOutlet NSMenuItem* standardMenu member in my MainController and connect the "menu" outlets of the popup buttons to this, but this leaves the "fake" menus in the hierarchy. Surely, there's a clean way of doing this from inside IB? Thanks in advance for any advice you might be able to give.

    Read the article

  • Save NSWindow Size on Resize & Close For User

    - by incarna
    I've noticed that all applications on OS X seem to save the size you set it at. The next time you open it it's typically in the same position and size. I'm making an app and I've noticed that after resizing, if I launch the application again it's just the size of what I've set in Xcode 4's IB and not the size that I resized it to on launch. Do I have to manually save the window size each time its changed? Or is there an easier way to do this through IB? (My window does have a minimum size set if that changes anything.)

    Read the article

  • First iPhone App View Position Problem

    - by hytparadisee
    I am closely following the instructions given in the tutorial "Your First iPhone Application" on apple ADC. In the interface builder, I have set up a button positioned on the top according to the Apple Interface Guidelines. It runs without trouble if I simulate the interface in IB. However, if I run the built app, I get what is shown here. If you look at the view clearly, you will see that the entire view has been shifted up. And the magnitude of the shift is exactly the height of the status bar. And that's why the there is blank space at the bottom of the window, which was white instead of red. I have tried turning on the "Simulated Interface Elements", but that doesn't work either. The problem persists on real devices as well. However, using the "Simulate Interface" from IB looks fine. Any help is appreciated. Yun Tao

    Read the article

  • UITableViewController setting delegates and datasource

    - by the_great_monkey
    Hi iOS gurus, I'm a little bit confused about UITableViewController... As far as I concern they are typically the delegate and datasource of the UITableView (although it can be made such that they are different). However in some cases, like when embedding a UITableViewController in a UITabBarViewController in Interface Builder, we initiate our table view controller in IB. Therefore in my understanding, the default initialiser is being called. But in this case, I have this piece of code: @interface Settings : UITableViewController { } And in the IB I see that the delegate and datasource of the UITableView is hooked up to this class. My question is, why is it that we don't need to explicitly say that it is following: @interface Settings : UITableViewController <UITableViewDelegate, UITableViewDataSource> { } And in the .m file: - (void)viewDidLoad { [super viewDidLoad]; [tableView setDelegate:self]; [tableView setDataSource:self]; } I have indeed stumbled upon some cases where I have to explicitly code the above a few times to make something work. Although it is still a mystery for me as of why it is needed...

    Read the article

  • Cocoa (Touch) for Swing Developers #1: Where Are the Layouts?

    - by yar
    My iPhone SDK and Objective-C learning is moving ahead quickly, thanks to several great books and online help (including this one). But I do have some basic questions due to what I already know that will be answered eventually, but I'd rather get a heads-up now if possible :) Are there equivalents for LayoutManagers in Cocoa Touch? Are they used, or is absolute positioning used instead? I have seen some of the layout stuff in IB, but I'm not sure what to look at in code. Aside from using the IB, are UIControls added directly to UIView instances using the addSubview (like add in Swing)? These are just two concrete questions that I've thought of just now, but I would love to see any translation of Swing concepts to Cocoa Touch.

    Read the article

  • InfiniBand Enabled Diskless PXE Boot

    - by Neeraj Gupta
    If you ever need to bring up a computer with InfiniBand networking capabilities and diagnostic tools, without even going through any installation on its hard disk, then please read on. In this article, I am going to talk about how to boot a computer over the network using PXE and have IPoIB enabled. Of course, the computer must have a compatible InfiniBand Host Channel Adapter (HCA) installed and connected to your IB network already. [ Read More ]

    Read the article

  • Which statically typed languages support intersection types for function return values?

    - by stakx
    Initial note: This question got closed after several edits because I lacked the proper terminology to state accurately what I was looking for. Sam Tobin-Hochstadt then posted a comment which made me recognise exactly what that was: programming languages that support intersection types for function return values. Now that the question has been re-opened, I've decided to improve it by rewriting it in a (hopefully) more precise manner. Therefore, some answers and comments below might no longer make sense because they refer to previous edits. (Please see the question's edit history in such cases.) Are there any popular statically & strongly typed programming languages (such as Haskell, generic Java, C#, F#, etc.) that support intersection types for function return values? If so, which, and how? (If I'm honest, I would really love to see someone demonstrate a way how to express intersection types in a mainstream language such as C# or Java.) I'll give a quick example of what intersection types might look like, using some pseudocode similar to C#: interface IX { … } interface IY { … } interface IB { … } class A : IX, IY { … } class B : IX, IY, IB { … } T fn() where T : IX, IY { return … ? new A() : new B(); } That is, the function fn returns an instance of some type T, of which the caller knows only that it implements interfaces IX and IY. (That is, unlike with generics, the caller doesn't get to choose the concrete type of T — the function does. From this I would suppose that T is in fact not a universal type, but an existential type.) P.S.: I'm aware that one could simply define a interface IXY : IX, IY and change the return type of fn to IXY. However, that is not really the same thing, because often you cannot bolt on an additional interface IXY to a previously defined type A which only implements IX and IY separately. Footnote: Some resources about intersection types: Wikipedia article for "Type system" has a subsection about intersection types. Report by Benjamin C. Pierce (1991), "Programming With Intersection Types, Union Types, and Polymorphism" David P. Cunningham (2005), "Intersection types in practice", which contains a case study about the Forsythe language, which is mentioned in the Wikipedia article. A Stack Overflow question, "Union types and intersection types" which got several good answers, among them this one which gives a pseudocode example of intersection types similar to mine above.

    Read the article

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