What wrong with this?

Discussion in 'iOS Development' started by ubunix, Sep 12, 2008.

  1. ubunix

    ubunix Member

    Joined:
    Aug 6, 2008
    Messages:
    637
    Likes Received:
    1
    Device:
    iPhone 5 (Black)
    I cant compile this?
    Code:
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    #import <UIKit/UIWindow.h>
    #import <CoreFoundation/CoreFoundation.h>
    #import <CoreGraphics/CoreGraphics.h>
    #import <GraphicsServices/GraphicsServices.h>
    #import <WebCore/WebFontCache.h>
    #import <UIKit/UITextView.h>
    #import <UIKit/UIView.h>
    
    
    @interface TextView : UIApplication
    {
    	UIAlertSheet* sheet;
    	UITextView* textView;
    	UIWindow* window;
    	CGRect rect;
    	UIView* mainView;
    }
    - (void)applicationDidFinishLaunching:(NSNotification*)loadNotfication;
    - (void)dealloc;
    @end
    Code:
    #import "TextView.h"
    
    @implementation TextView
    - (void)applicationDidFinishLaunching:(NSNotification*)loadNotfication
    {
    	rect = [ UIHardware fullScreenApplicationContentRect ];
    	rect.origin.x = 0.0f;
    	rect.origin.y = 0.0f;
    	
    	window = [ [ UIWindow alloc ] initWithContentRect: rect ];
    	[ window makeKeyAndVisible ]; 
    	
    	mainView = [ [ UIView alloc ] initWithFrame: rect ];
    	
    	
    // Heres my problem?
    
    
    	CGRect frame = CGRectMake(0.0, 0.0, 100.0, 100.0);
       
    	UITextView *textView = [[[UITextView alloc] initWithFrame:frame] autorelease];
        textView.textColor = [UIColor blackColor];
        textView.font = [UIFont fontWithName:kFontName size:kTextViewFontSize];
        textView.delegate = self;
        textView.backgroundColor = [UIColor whiteColor];
    	
    	textView.text = @"Whatever text here.";
    
    	[mainView setSubview: textView];
    
    //end
    
    	
    
    
    }
    
    - (void)dealloc
    {
    	[window release];
    	[mainView release];
    	[textView release];
    	
    	[super dealloc];
    	
    }
    
    @end
    	
    Heres the error message
    Code:
    FWViewer.m: In function '-[FWViewer applicationDidFinishLaunching:]':
    FWViewer.m:22: warning: local declaration of 'textView' hides instance variable
    FWViewer.m:22: error: 'UIColor' undeclared (first use in this function)
    FWViewer.m:22: error: (Each undeclared identifier is reported only once
    FWViewer.m:22: error: for each function it appears in.)
    FWViewer.m:23: warning: local declaration of 'textView' hides instance variable
    FWViewer.m:23: error: request for member 'font' in something not a structure or union
    FWViewer.m:23: error: 'UIFont' undeclared (first use in this function)
    FWViewer.m:23: error: 'kFontName' undeclared (first use in this function)
    FWViewer.m:23: error: 'kTextViewFontSize' undeclared (first use in this function)
    FWViewer.m:24: warning: local declaration of 'textView' hides instance variable
    FWViewer.m:25: warning: local declaration of 'textView' hides instance variable
    FWViewer.m:27: warning: local declaration of 'textView' hides instance variable
    FWViewer.m:28: warning: local declaration of 'textView' hides instance variable
    FWViewer.m:28: error: 'UIReturnKeyDefault' undeclared (first use in this function)
    FWViewer.m:29: warning: local declaration of 'textView' hides instance variable
    FWViewer.m:29: error: request for member 'keyboardType' in something not a structure or union
    FWViewer.m:29: error: 'UIKeyboardTypeDefault' undeclared (first use in this function)
    FWViewer.m:31: warning: local declaration of 'textView' hides instance variable
    FWViewer.m:31: warning: 'UIView' may not respond to '-setSubview:'
    FWViewer.m:31: warning: (Messages without a matching method signature
    FWViewer.m:31: warning: will be assumed to return 'id' and accept
    FWViewer.m:31: warning: '...' as arguments.)
    
  2. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    for starters, UIAlertSheet no longer exists in the UIKit framework.
  3. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    i'm having this problem too so which framework is AlertSheet now in???

    edit

    ok im trying to compile what i've got for now but I get this error help??

    iSpring.m:5: warning: cannot find interface declaration for 'iSpring'
    iSpring.m:7: error: expected ':' before '=' token
    iSpring.m:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    iSpring.m:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    iSpring.m:14: warning: data definition has no type or storage class
    iSpring.m:14: error: 'rect' undeclared here (not in a function)
    iSpring.m:14: warning: initialization makes integer from pointer without a cast
    iSpring.m:14: error: initializer element is not constant
    iSpring.m:15: error: expected identifier or '(' before '[' token
    iSpring.m:19: warning: data definition has no type or storage class
    iSpring.m:19: warning: initialization makes integer from pointer without a cast
    iSpring.m:19: error: initializer element is not constant
    iSpring.m:23: error: expected identifier or '(' before '[' token
    iSpring.m:29: error: initializer element is not constant
    iSpring.m:30: error: initializer element is not constant
    iSpring.m:31: error: expected identifier or '(' before '[' token
    iSpring.m:32: error: expected identifier or '(' before '[' token
    iSpring.m:33: error: expected identifier or '(' before '[' token
    iSpring.m:34: error: expected identifier or '(' before '[' token
    iSpring.m:35: error: expected identifier or '(' before '}' token
    iSpring.m:36: error: expected identifier or '(' before 'return'
    iSpring.m:37: error: expected identifier or '(' before '}' token
    iSpring.m: In function '-[iSpring navigationBar:buttonClicked:]':
    iSpring.m:42: error: expected expression before '=' token
    iSpring.m:45: error: 'sheet' undeclared (first use in this function)
    iSpring.m:45: error: (Each undeclared identifier is reported only once
    iSpring.m:45: error: for each function it appears in.)
    iSpring.m: In function '-[iSpring dealloc]':
    iSpring.m:61: error: no super class declared in @interface for 'iSpring'
    make: *** [iSpring.o] Error 1

    edit!!!

    dosen't matter I deleted all my work and decided to start again oh well!!!
  4. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    you have so much sh*t wrong there, i would simply suggest rewriting everything from scratch, rather than COPYING AND PASTING, which i hate to see ppl doing
  5. spoonforknife

    spoonforknife Retired Moderator

    Joined:
    Nov 15, 2007
    Messages:
    6,896
    Likes Received:
    317
    UIAlertSheet is now UIActionSheet.
  6. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    actually, UIActionSheet is the sheet that slides up from the bottom of the screen.

    UIAlertView is the new "popup" sheet.

Share This Page