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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:45:22+00:00 2026-05-27T08:45:22+00:00

I basically want to use the PlacardView.m and PlacardView.h from the Apple’s MoveMe example,

  • 0

I basically want to use the PlacardView.m and PlacardView.h from the Apple’s MoveMe example, by adding it as a subview on my main BlowViewController

PlacardView.m

#import "PlacardView.h"

@implementation PlacardView

@synthesize placardImage;



- (id)init {
    // Retrieve the image for the view and determine its size
    UIImage *image = [UIImage imageNamed:@"Placard.png"];
    CGRect frame = CGRectMake(0, 0, image.size.width, image.size.height);

    // Set self's frame to encompass the image
    self = [self initWithFrame:frame];
    if (self) {
        self.opaque = NO;
        placardImage = image;
        }
    return self;
}


- (void)dealloc {
    [placardImage release];
    [super dealloc];
}





@end

PlacardView.h

@interface PlacardView : UIView {
    UIImage *placardImage;

}

@property (nonatomic, retain) UIImage *placardImage;

// Initializer for this object
- (id)init;

@end

This is my MicBlowViewController.h

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <CoreAudio/CoreAudioTypes.h>

@class PlacardView;

@interface MicBlowViewController : UIViewController {
    AVAudioRecorder *recorder;
    NSTimer *levelTimer;
    double lowPassResults;

    PlacardView *placardView;
}


@property(nonatomic, retain) PlacardView *placardView;
- (void)setUpPlacardView;
- (void)levelTimerCallback:(NSTimer *)timer;

@end

This is the partial MicBlowViewController.m .. there is a function viewDidLoad but that has nothing to do with the views.. its simply a timer for audio recording so I am not pasting that

#import "MicBlowViewController.h"
#import "PlacardView.h"

@implementation MicBlowViewController

    - (id)initWithFrame:(CGRect)frame {

        self = [super initWithFrame:frame];
        if (self) {
            [self setUpPlacardView];
        }
        return self;
    }


    - (void)setUpPlacardView {
        // Create the placard view -- its init method calculates its frame based on its image
        PlacardView *aPlacardView = [[PlacardView alloc] init];
        self.placardView = aPlacardView;
        [aPlacardView release];
        placardView.center = self.center;
        [self addSubview:placardView];
    }

The error I get is “Property ‘center’ not found on object of type “MicBlowViewController *””

Please help.

  • 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-27T08:45:23+00:00Added an answer on May 27, 2026 at 8:45 am

    Ayush, your code leaves me somewhat puzzled.

    The code for your controller seems to have several problems.

    A UIViewController does not have an initWithFrame method, but rather a standard init, or an initWithNibName:bundle: method if using an Interface Builder file.

    I see you have copied and pasted code from Apple’s MoveMe example, however, bear in mind that the MoveMeView from which you have copied the code into your controller is actually a UIView and not a UIViewController.

    Try this:

    #import "MicBlowViewController.h"
    #import "PlacardView.h"
    
    @implementation MicBlowViewController
    
        - (void)viewDidLoad {
    
            [self setUpPlacardView];
    
            // Additonal code with your timer etc
        }
    
    
        - (void)setUpPlacardView {
            // Create the placard view -- its init method calculates its frame based on its image
            PlacardView *aPlacardView = [[PlacardView alloc] init];
            self.placardView = aPlacardView;
            [aPlacardView release];
            [self.view addSubview:placardView];
            self.placardView.center = self.view.center;
        }
    

    You will probably also need to implement the loadView method of your MicBlowViewController.

    You may want to check out View Programming Guide, as well as UIViewController class reference.

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

Sidebar

Related Questions

I basically want to use the XML parser from Qt in my existing project.
So, I just basically want to use AVFoundation Kit for playing my sound. I
basically what i want is redirect al request to use HTTPS instead of http
Basically, what I want is to use an alternative to the login cookies as
what I want to do is to use something like name=validate[required] basically use it
Basically, I just want to know if its possible to use Nhibernate to migrate
I basically want to use str_replace() all values of a multidimensional array. I can't
I use eclipse and svn 1.6 What I basically want is to be able
Basically I want to use uniqueidentifier in similar way as identity. I don't want
Basically I want to use a dynamic data website to maintain data in an

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.