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 7595903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:47:20+00:00 2026-05-30T21:47:20+00:00

My button won’t display. Does anyone know why? #import ViewController.h @implementation ViewController – (void)viewDidLoad

  • 0

My button won’t display. Does anyone know why?

#import "ViewController.h"


@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];


    CTrial *tt = [CTrial alloc];
    [tt hellothere:self]; 
}


/////////////////////////////
#import "CTrial.h"
@implementation CTrial


- (void) hellothere: (UIViewController*) ss
{
    UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btn2 setTag:200];
    [btn2 addTarget:self action:@selector(menuSetup:) forControlEvents:UIControlEventTouchUpInside];
    [btn2 setFrame:CGRectMake(0,0,300,200)];
    [ss.view addSubview:btn2];
}

I have tried “id”

- (id) hellothere: (UIViewController*) ss

with the return but still nothing

#import <UIKit/UIKit.h>
#import "CButton.h"

@interface CTrial : //UIView

-(void) menuSetup:(UIButton*) btn;
- (id) hellothere: (UIViewController*) ss;
//- (void) hellothere: (UIViewController*) ss;
@end
  • 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-30T21:47:21+00:00Added an answer on May 30, 2026 at 9:47 pm

    Use

    UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    

    You usually use UIButtonTypeCustom if you want to display a custom button, for example displaying an image instead of the classical button, but since you are not assigning any image to the button it’s simply transparent, that is why you cannot see it.

    Besides use

    CTrial *tt = [[CTrial alloc] init];
    

    alloc simply allocate the memory, does not initialize your object

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

Sidebar

Related Questions

For some reason, the button initialized in the addBook method of my viewController won't
Is there ASP button that won't submit post form data. Whenever I click an
I can't figure out why this simple update command won't work: private void button1_Click(object
Button class: class SubmitButton extends JButton implements ActionListener { public SubmitButton(String title){ super(title); ....
Code: button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // fileReader(); new xyz().execute(); }//
Why won't this work? View1 loads View2. In view2: - (void) goToView { View3
I have an 'info' button that does a modal flip to an info page.
For some reason my javascript won't execute when my submit button is pressed. It's
I'm trying to get #content to toggle, but it won't work. $(button).click(function () {
A custom Dialog box with a RelativeLayout contains a Button widget that won't change

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.