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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:27:07+00:00 2026-06-02T06:27:07+00:00

It is really strange that for a Single View app, I added a MainView

  • 0

It is really strange that for a Single View app, I added a MainView class and made the ViewController.xib to use custom class of MainView, and catch the touchesMoved event in ViewController.m, and record the dot (the location).

Then in drawRect inside MainView.m, I draw the dot. So when the program runs, all I see is a single dot on the screen, drawn to where my finger moves to…

However, as soon as I added initWithCoder to MainView.m, the behavior is totally different. It seems like the view won’t clear its content before drawing the dot, and all the dots previously drawn remain on screen, but the screen flashes a lot (I am using the new iPad with the new GPU)… seems like there are several “buffers”, some with different sets of old dots, and another buffer had different set of old dots… When my finger left the screen, it could be one of those buffers (a random buffer with different set of dots). (one more thing: the background of the screen changed to all black. Before, it was grey or whatever color Interface Builder set the view to). Why does adding the initWithCoder as follow will create such effect?

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {

    }
    return self;
}
  • 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-06-02T06:27:09+00:00Added an answer on June 2, 2026 at 6:27 am

    Your initWithCoder: method is wrong. You have to call [super initWithCoder:aDecoder], not plain old [super init], otherwise all the information from the xib file (including the redraw options and background colour) is lost – the aDecoder object contains all this information, and you are discarding it.

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

Sidebar

Related Questions

I've got a really simple class that is giving a strange error. The class
This is a really strange problem, that appears to be somewhat intermittent (although it
I'm experiencing something really strange! I have a div that I'm hiding with JS
I've run into a really strange bug, that I'm hoping someone can explain. I
I have a kind of strange thing that I really nead for my text
So I'm really new to Rails, and I'm getting a strange error that I
I'm facing a problem that's really strange. It's in every browser. Everything is working
I have a really strange orientation issue. I have a sequence of view controllers
Getting something really strange that I just can't work out. I have 3 methods
Hey guys, I'm getting a really strange error. I have a program that needs

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.