In the Memory Management Programming Guide for Cocoa Apple talks about Top-Level Objects. They say, that I need an Outlet for each of them.
If there are any top-level objects you
do not store in outlets, however, you
must retain either the array returned
by the loadNibNamed:owner:options:
method or the objects inside the arra...
I had an nice UIScrollView inside my nib, which worked nicely. Then I had some very special needs and subclassed UIScrollView. In my Nib, I changed the class in the identity inspector to my subclass.
But for some reason, my -initWithFrame: method gets never called when the nib loader builds up all those objects from the nib. Actually I ...
I want to load a nib that isn't a view in a UITabViewController. Here's what I have now and it isn't working, but it should give you an idea of what I want:
- (IBAction)PlaylistButtonPressed:(id)sender
{
MusicPick *music = [[MusicPick alloc] initWithNibName:@"MusicPick" bundle:nil];
[self.view addSubview:music.view];
[mus...
If I have a directory in my Xcode project (not a Group), which is added to the main target, and compile it, how do I instruct an NSViewController to initWithNibName:bundle: a nib file inside that directory?
I've tried [viewController initWithNibName:@"FolderName/NibName" bundle:nil], but that doesn't work. Neither does without the folde...
I've choosen the "view-based" application template in Xcode. The myProjectViewController.m has the following code:
/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/
That sounds good. But: The template generated a myProjectViewController.xib file. What I dont get is: How ...
I have an class that inherits from UIViewController. There, I want to make some ivar initialization like this:
- (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle { // Load the view nib
NSLog(@"Hello Earth!");
if (self = [super initWithNibName:nibName bundle:nibBundle]) {
self.visibleIndex = 0;
NSLog...
What's the best way to check if a Nib or Xib file exists before trying to load it using initWithNibName:bundle: or similar?
...
Hi,
What's up with the NIB->XIB change somewhere between Xcode 3.0 to 3.1?
Is there any difference with this name change that I should know while I go through tutorials that mention nothing but the .nib file?
...
I have subclassed UIViewController into a new class, PageViewController (I'm writing a simple book app). I want to add a new view loaded from a nib file and am using the following code. It works.
PageViewController *viewController1 = [[UIViewController alloc] initWithNibName:@"Page1" bundle:nil];
[viewController1.view setUserInteraction...
I've to custom cells each in an seperatea .xib file (and for each of them a seperate .h and .m file)
I need these two custom cells in my tableview (Controller). Thats an seperate file, too.
How is it posible to link the two custom cells to the tableviewController?
...
I am curious to know if anyone has any experience comparing the load time performance of iPhone apps with views laid out in NIBs vs. views laid out entirely programmatically (i.e. instantiating UITextView, adding it to the view, instantiating UIButton, adding it to the view…).
If I want a simple app to load lightning fast, would it be b...
I am trying to create a custom UIView that is stored in a nib so that I can position it using Interface Builder.
I have created a class called RippleView that extends UIView. I'd like to position this view as a subview using Interface Builder. To do so, I've dragged a new view into my existing view in Interface Builder and gave it the R...
Interface Builder provides the ability to create non-view/controller objects in a XIB file. In the past I have used this feature to instantiate and wire-up small components that manage view components in the XIB and this seemed a fairly reasonable thing to do.
However, I was wondering what other legitimate uses there are for this featur...
I put this code into all of my viewControllers:
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (orientation == UIInterfaceOrientationLandscapeRight) {
CGAffineTransform transform = self.view.transform;
// Use the status bar frame to determine the center point of the window's con...
I have a subclass of UITableViewCell and am trying to use it. At the moment it does display fine as a test but I get leaking errors to the console...
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CustomCellIdentifier = @"CustomCellIdentifier ";
...
I am adding a viewController to a TabBarController. When I add a ViewController from the custom class and Nib, it''s icon does not show up in the tabBar.
If I initialize like this the icon does not show up.
viewController = [[FlashCardViewController alloc] initWithNibName:@"FlashCardViewController" bundle:[NSBundle mainBundle]];
Bu...
MyController *myViewController = [[MyController alloc] initWithNibName:@"myView" bundle:nil];
The nib file myView.nib has 2 uiimageviews and 2 uilabels. When I first init myViewController, all the 4 subviews are set as 0x0.
The second time I dont get such a behavior.
...
Since KVC is used to set outlets on the iPhone, there are 2 methods (that I know of) to make sure you've properly handled memory management.
Specifically, I am referring to this article written by Aaron Hillegass.
My question is which method do you use and what is your reasoning?
Release all your outlets in dealloc
and viewDidUnload ...
I was wondering if there is a difference between using .xib files for GUI design and doing this programmatically.
As it is a compiler I would assume that there is no relevant time lost.
Am I wrong?
...
Hi Guys
I created a nib file and want to display dynamic text messages on it like file names that are selected or the no of files selected etc. Is there a way to to this?
I know this can be done for alert panels but i want it on my custom sheets.
Thanks
...