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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:01:27+00:00 2026-05-23T13:01:27+00:00

I am creating a UIView class . in the implementation there is a function

  • 0

I am creating a UIView class . in the implementation there is a function

- (id)initWithFrame:(CGRect)frame

I am adding a button in the class which is used to reload the class.

I would like to call the class initialization function when the button is pressed so that the view is refreshed and it comes back to its intialization state.

Is there a function which can be used to roll back the view to its intialized state?

  • 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-23T13:01:28+00:00Added an answer on May 23, 2026 at 1:01 pm

    You should not call -init methods more then once for the same object.

    The solution for your problem however is simple – move all your setting properties code to a separate function, e.g. -setupDefaultProperties and call it in your initWithFrame method and whenever you want to reset the view to its initial state

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

Sidebar

Related Questions

I am creating a UIImage programmatically in my UIView's drawRect function. Is there a
I am creating a custom StyleLabel by extending the UIView, which provides a link
I am creating a loading screen UIView which is added to a subview while
I'm working on creating a UIView subclass (which I'm calling MarqueeLabel ) that animates
In my iPhone app, I have SPGameDesk : UIView class, creating it from other
I am creating a UIView-based application named myapp . I am adding a UIViewController
When creating a UIView with a navigation bar in interface builder, the top bar
I need to create my own UIView class and it is not something I
When creating a UIViewController derived class in objective-C, what goes into the init method,
I have a View Controller that is swapping UIView objects in and out. There

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.