Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3244714
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:35:03+00:00 2026-05-17T18:35:03+00:00

This is my first post on SO, so hi! I’m new to Xcode and

  • 0

This is my first post on SO, so hi!

I’m new to Xcode and Obj-C too so don’t be too harsh.

I am following the demo from Standford University youtube.com/watch?v=L-FK1TrpUng
For some reason i’ve hit an error. Rather than starting from scratch i’d prefer to figure out where I have gone wrong.

Ok so here goes.

I have two view controllers and i’m currently learning about push and pop.

My first view controllers (firstViewController.h) header:

    #import <UIKit/UIKit.h>       
@interface FirstViewController : UIViewController {
    }
     - (IBAction)pushViewController:(id)sender;
    @end

Then initially this was set up in the implementation file (firstViewController.m), like this

#import "firstViewController.h"
    @implementation FirstViewController
    - (IBAction)pushViewController:(id)sender{
}

At this point with IB I ctrl dragged from ‘File’s owner’ to a ‘UIButton’ and connected ‘pushViewController’

However, somewhere along the way I received somekind of error, which I ignored.

Now I have my second view controller added into my firstViewController.m like this;

#import "firstViewController.h"
#import "secondViewController.h"

@implementation FirstViewController

    - (IBAction)pushViewController:(id)sender{
     SecondViewController *secondViewController = [[SecondViewController alloc] init];
     secondViewController.title = @"Second"; 
     [self.navigationController pushViewController:secondViewController animated:YES];
     [secondViewController release];
    }

The error that I received previously seemed to somehow stop me from ctrl dragging from a textLabel in my secondViewController nib

(secondeViewController.h)

#import "firstViewController.h"
#import "secondViewController.h"


@implementation FirstViewController
- (IBAction)pushViewController:(id)sender{
 SecondViewController *secondViewController = [[SecondViewController alloc] init];
 secondViewController.title = @"Second";
 [self.navigationController pushViewController:secondViewController animated:YES];
 [secondViewController release];
}

So i removed the references from my original UIButton via right clicking on it in the firstViewController.xib.

Now I cannot recreate the link from ‘File’s Owner’ to the ‘UIButtons’, ‘pushViewController’ outlet (is it an outlet or is it an action?) nor create the link in my secondViewControllers nib from ‘File’s Owner’ to the ‘UILabel’.

Any help?

Project files here if anyone is interested. http://zer-o-one.com/upload/files/PushPop.zip

Much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:35:04+00:00Added an answer on May 17, 2026 at 6:35 pm

    An outlet is a path that connects one object to another. An action is a method name that is called on a particular object in response to an event. Cocoa traditionally uses target/action quite a lot for communicating, though this is now being partly displaced by blocks.

    Anyway, your project:

    The firstViewController.xib incorrectly thinks that its file owner is a class of type ‘firstViewController’. It’s actually of type ‘FirstViewController’ — like most programming languages, Objective-C is case sensitive for class names. In Interface Builder, open firstViewControlller.xib, select ‘File’s Owner’, open the inspector and head to the ‘i’ tab, then correct the class name at the top. When you’ve done that, try switching to the connections tab (the one with the arrow pointing to the right) and you should see that it’s correctly found your class and your IBAction. You should then be able to control drag.

    Basically the same comment applies to secondViewController.

    In case you’re curious, Objective-C differs from e.g. C++ in that all class names are known at runtime and it’s possible to instantiate a class from the string version of its name. That’s how XIBs/NIBs are loaded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first post here and I wanted to get some input from
this is first post here and I am a noob programmer. This may be
This is my first post and I'm quite a novice on C++ and compiling
This is my first post on StackOverflow, so please be gentle... I have some
This is my first post on this rather spiffing website so go easy on
this is my first post here. I'm using an existing Flash widget but would
I am trying to understand how to use SyndicationItem to display feed which is
A bit of background information: Inorder to read/write to SLE4442 memory cards, my app
I'm trying to cache some application data that only needs to be instantiated when
I am trying to run a timer in the background of my application, i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.