Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-21-2011, 10:12 AM   #1 (permalink)
kaz
Registered Member
 
Join Date: Feb 2011
Posts: 4
kaz is on a distinguished road
Default accessing unknown 'view' class method

Hi. I'm a beginner developer, i'm using a book to learn about development.
I was going through a tutorial on how to build a simple table view application, i followed all of the instructions carefully, i'm only coming up with one error with the following code:

- (BOOL)applicationUIApplication *)application didFinishLaunchingWithOptionsNSDictionary *)launchOptions {

// Override point for customization after application launch
[window addSubview:FlowerColorTableViewController.view];
[window makeKeyAndVisible];

return YES;
}


the bit marked in red comes up with the error "accessing unknown 'view' class method" even though it looks exactly the same in the book.

HELP PLEASE!!!
kaz is offline   Reply With Quote
Old 02-21-2011, 10:15 AM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Do you have a variable named "FlowerColorTableViewController" in your .h file? Keep in mind that capitalization matters since you are new to development.
smithdale87 is offline   Reply With Quote
Old 02-21-2011, 11:28 AM   #3 (permalink)
kaz
Registered Member
 
Join Date: Feb 2011
Posts: 4
kaz is on a distinguished road
Default

Quote:
Originally Posted by smithdale87 View Post
Do you have a variable named "FlowerColorTableViewController" in your .h file? Keep in mind that capitalization matters since you are new to development.
Thanks for the reply, i have two .h files, one is the app delegate and one is the view controller that i created. which one are you talking about and whats a variable? Thanks in advance
kaz is offline   Reply With Quote
Old 02-22-2011, 04:06 AM   #4 (permalink)
- U haz disappoint -
 
Join Date: Jan 2010
Location: Belgium
Posts: 489
jNoxx is on a distinguished road
Send a message via MSN to jNoxx Send a message via Skype™ to jNoxx
Default

Seriously, if u don't know what a variable is, go to the store, grab the nearest book about programming, and read.
U want us to help u, if u can't understand the BASICS of programming, no offense, i want to help newbies, but they have to do an basic effort too..
jNoxx is offline   Reply With Quote
Old 02-22-2011, 02:22 PM   #5 (permalink)
kaz
Registered Member
 
Join Date: Feb 2011
Posts: 4
kaz is on a distinguished road
Default

Quote:
Originally Posted by jNoxx View Post
Seriously, if u don't know what a variable is, go to the store, grab the nearest book about programming, and read.
U want us to help u, if u can't understand the BASICS of programming, no offense, i want to help newbies, but they have to do an basic effort too..
sorry, i found out what a variable is, my view controller file reads:

#import <UIKit/UIKit.h>


@interface FlowerColorTableViewController : UITableViewController {
NSMutableArray *redFlowers;
NSMutableArray *blueFlowers;

}

@end
kaz is offline   Reply With Quote
Old 02-22-2011, 02:28 PM   #6 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

I think I know what your problem is.

You need to alloc an instance of FLowerColorTableViewController, and then add that instance's view to your window. CUrrently, you are doing some other hocus pocus.

Code:
- (BOOL)applicationUIApplication *)application didFinishLaunchingWithOptionsNSDictionary *)launchOptions { 

// Override point for customization after application launch

FlowerColorTableViewController* vc = // alloc a new one here, either from a xib, or the long way

[window addSubview: vc.view];
[window makeKeyAndVisible];


return YES;
}
smithdale87 is offline   Reply With Quote
Old 02-22-2011, 02:31 PM   #7 (permalink)
Registered Member
 
simplyDusty's Avatar
 
Join Date: Jan 2011
Posts: 158
simplyDusty is on a distinguished road
Default

You need to create a FlowerColorTableViewController object, then add the object's view as a subview. Currently, you're treating FlowerColorTableViewController as a static class.
simplyDusty is offline   Reply With Quote
Old 02-27-2011, 01:16 PM   #8 (permalink)
kaz
Registered Member
 
Join Date: Feb 2011
Posts: 4
kaz is on a distinguished road
Default

Quote:
Originally Posted by simplyDusty View Post
You need to create a FlowerColorTableViewController object, then add the object's view as a subview. Currently, you're treating FlowerColorTableViewController as a static class.
Thanks for the help. How would i do this? would i need to go to file>New File?
kaz is offline   Reply With Quote
Old 02-27-2011, 10:20 PM   #9 (permalink)
Registered Member
 
simplyDusty's Avatar
 
Join Date: Jan 2011
Posts: 158
simplyDusty is on a distinguished road
Default

Quote:
Originally Posted by kaz View Post
Thanks for the help. How would i do this? would i need to go to file>New File?
Smithdale posted the code right above my last post
simplyDusty is offline   Reply With Quote
Reply

Bookmarks

Tags
class, method, unknown, view

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 379
15 members and 364 guests
Absentia, cpsclicker, dre, Error404, Gaz, gmarro, jeroenkeij, Kirkout, mottdog, Music Man, PavelMik, teebee74, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:11 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0