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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 10-24-2009, 02:24 AM   #1 (permalink)
Banned
 
Join Date: Oct 2009
Location: East Bay, CA
Posts: 171
Exclamation HELP! Debugging, getting this working

hey, I'm 13 years old and I've been learning iphone development. The problem is i have no one that can look at it and constructively help me. So i was wondering if one of you could help me get rid of errors for this code.
All my classes is attached as a .zip so check em out please and help me out. currently it won't even run.




P.S. this code belongs to me, the poster, and cannot be sold commercially
Attached Files
File Type: zip template.zip (11.5 KB, 9 views)
youngcoder is offline   Reply With Quote
Old 10-24-2009, 02:30 AM   #2 (permalink)
Banned
 
Join Date: Oct 2009
Location: East Bay, CA
Posts: 171
Default

I'd appreciate any and all help. Im a budding programmer and am curious about the how to of this environment.
youngcoder is offline   Reply With Quote
Old 10-24-2009, 05:40 AM   #3 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: UK
Posts: 1,886
Default

It might help if you told us what errors you're getting...
harrytheshark is offline   Reply With Quote
Old 10-24-2009, 01:31 PM   #4 (permalink)
Banned
 
Join Date: Oct 2009
Location: East Bay, CA
Posts: 171
Default warnings im getting

Warning: 'setImage:' is deprecated (declared at /developer/platforms/iphoneSimulator.pltform/developer/SDKs/iPhoneSimulator3.1.sdk/System/Library/Frameworks/UIKit.framework/header/UITableViewCell.h:200)

~these warning dont prohibit building and running but i'd like to know what they mean, they are in the .m of the viewcontrollers


~ is in the viewcontroller.m

Warning: Control reaches end of non void function

~is in the viewcontroller.m


~Then i get the same errors over again
youngcoder is offline   Reply With Quote
Old 10-24-2009, 01:33 PM   #5 (permalink)
Banned
 
Join Date: Oct 2009
Location: East Bay, CA
Posts: 171
Default

Code:
  

- (void)applicationDidFinishLaunching:(UIApplication *)application 
{
	
	
	
	//put all the views into this array that you want in the tab bar:
	
	NSMutableArray *tabBarViewControllers = [[NSMutableArray alloc] init];
    UINavigationController *navigationController;
	
	//Create sales records view,navigation controller and add to array
	FirstViewController *tableviewcontroller = [[FirstViewController alloc] 
							   initWithStyle:UITableViewStyleGrouped];
	navigationController = [[UINavigationController alloc] init];
	navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
	[navigationController pushViewController:tableviewcontroller animated:NO];
	[tableviewcontroller release];
	[tabBarViewControllers addObject:navigationController];
	[navigationController release];
	
	//Create view and add to array
FirstViewController *vc = [[FirstViewController alloc] 
					initWithNibName :nil bunle:nil];

	 [tabBarViewControllers addObject:vc];
	[vc release];
	
	//Create the tab bar controller and add the views you created above
	UITabBarController *tabBarController = [[UITabBarController alloc] init];
	[tabBarController setViewControllers:tabBarViewControllers animated:NO];
	[tabBarViewControllers release];
	
	//Add the tab bar view to the window
	[window addSubview:tabBarController.view];
	
    // Override point for customization after application launch
    [window makeKeyAndVisible];
}
youngcoder is offline   Reply With Quote
Old 10-24-2009, 03:54 PM   #6 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 39
Default

Hi, ok here we are:

1st:

"Warning: Control reaches end of non void function"

This is caused by this function not returning a value, if a function is written to return a value ie the 1st enclosure, it must do so , in this case (NSInteger). So here you must return a integer that is the number of rows in the active section.

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
}

2nd:

"warning: format not a string literal and no format arguments"

You dont need the NSString creation in a NSLog you can simply do this

NSLog(@"clicked index : %i",index);


3rd:
"warning: 'setImage:' is deprecated"

With 0S3.0 UITableCell.image is deprecated you should now use UITableCell.imageView.image.
This means it will still build but in a future OS version this call will be removed and it will stop working. Youll also see this warning on the cell.text line.

hth

Neil.
neilkachu is offline   Reply With Quote
Old 10-24-2009, 05:11 PM   #7 (permalink)
Banned
 
Join Date: Oct 2009
Location: East Bay, CA
Posts: 171
Default thanks but...

Thanks for the explanation, i don't understand where to add the UITableViewCell.imageView.image

Also, is there any way to fix the problem
Warning: Local declaration of 'navigationController' hides instance variables

it appears here
Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application 
{
	
	
	
	//put all the views into this array that you want in the tab bar:
	
	NSMutableArray *tabBarViewControllers = [[NSMutableArray alloc] init];
    UINavigationController *navigationController;
	
	//Create sales records view,navigation controller and add to array
	FirstViewController *tableviewcontroller = [[FirstViewController alloc] 
							   initWithStyle:UITableViewStyleGrouped];
	navigationController = [[UINavigationController alloc] init];
	navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
	[navigationController pushViewController:tableviewcontroller animated:NO];
	//[tableviewcontroller release];
	[tabBarViewControllers addObject:navigationController];
	[navigationController release];
	
	//Create view and add to array
	FirstViewController *vc = [FirstViewController alloc] ;
						   //initWithNibName :nil bunle:nil];

	 [tabBarViewControllers addObject:vc];
	[vc release];
	
	//Create the tab bar controller and add the views you created above
	UITabBarController *tabBarController = [[UITabBarController alloc] init];
	[tabBarController setViewControllers:tabBarViewControllers animated:NO];
	[tabBarViewControllers release];
	
	//Add the tab bar view to the window
	[window addSubview:tabBarController.view];
	
    // Override point for customization after application launch
    [window makeKeyAndVisible];
}
Thanks again for the quick help
youngcoder is offline   Reply With Quote
Old 10-24-2009, 07:05 PM   #8 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 39
Default

Hi,

#1
in cellForRowAtIndexPath youre setting the cell.image= and cell.text=, these will need changing to cell.imageView.image= and cell.textLabel.text= to be compatible with later OS versions.

#2

"Warning: Local declaration of 'navigationController' hides instance variables"

this is beacuse you declare navigationController in the applicationDidFinishLaunching function:
UINavigationController *navigationController;

but you've already set navigationController to be a class instance property in the .h file, you cant have both, so just remove the above line and this will fix this.


hth, Neil
neilkachu is offline   Reply With Quote
Old 10-24-2009, 09:07 PM   #9 (permalink)
Banned
 
Join Date: Oct 2009
Location: East Bay, CA
Posts: 171
Default Thanks for your help

thank you so much, that got rid of all the warnings, but "Warning control = end of non-void function. Also i get an error expected identifier '(' before = token

located in
Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application 
{
	
	
	//put all the views into this array that you want in the tab bar:
	
	NSMutableArray *tabBarViewControllers = [[NSMutableArray alloc] init];
    //UINavigationController *navigationController;
	
	//Create sales records view,navigation controller and add to array
	FirstViewController *tableviewcontroller = [[FirstViewController alloc] 
							   initWithStyle:UITableViewStyleGrouped];
	//here is where the error happens 
navigationController = [[UINavigationController alloc] init];
	navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
	[navigationController pushViewController:tableviewcontroller animated:NO];
	//[tableviewcontroller release];
	[tabBarViewControllers addObject:navigationController];
	[navigationController release];
	
	//Create view and add to array
	FirstViewController *vc = [FirstViewController alloc] ;
						   //initWithNibName :nil bunle:nil];

	 [tabBarViewControllers addObject:vc];
	[vc release];
	
	//Create the tab bar controller and add the views you created above
	UITabBarController *tabBarController = [[UITabBarController alloc] init];
	[tabBarController setViewControllers:tabBarViewControllers animated:NO];
	[tabBarViewControllers release];
	
	//Add the tab bar view to the window
	[window addSubview:tabBarController.view];
	
    // Override point for customization after application launch
    [window makeKeyAndVisible];
}
youngcoder is offline   Reply With Quote
Old 10-24-2009, 09:12 PM   #10 (permalink)
Banned
 
Join Date: Oct 2009
Location: East Bay, CA
Posts: 171
Default solution/problem

i found by deleting the line in the header file and replacing it in applicationdidfinishlaunching, i was able to build and run with no errors. BUT it displays as a white screen in the Simulator. what do i do

Last edited by youngcoder; 10-24-2009 at 09:43 PM.
youngcoder is offline   Reply With Quote
Old 10-25-2009, 09:30 AM   #11 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 39
Default

Hi,

If you'd like to pm me the entire project Ill have a look at this tomorrow.
You seem to be hitting some quite simple beginners errors, are you working from scratch or from a book. I can highly recommend the Beginning iPhone 3 Development book if you're starting out, this will help you get the fundamental things right and you should then be able to make the app you want without all these errors.

Neil
neilkachu is offline   Reply With Quote
Old 10-25-2009, 03:47 PM   #12 (permalink)
Banned
 
Join Date: Oct 2009
Location: East Bay, CA
Posts: 171
Default here is a new problem

everything runs into the simulator just fine, but, when i navigate between the students/parents/other tab

I lose the navigation bar in the parents and others tab and they appear with no information, even though information is set.

what do i do?
I've included the updated (working) classes folder, thanks for helping a beginner =)


also the table view on the student tab is very buggy (with the accessory indicator and color) why is this happening?
Attached Files
File Type: zip Classes.zip (13.5 KB, 2 views)

Last edited by youngcoder; 10-25-2009 at 03:51 PM.
youngcoder is offline   Reply With Quote
Reply

Bookmarks

Tags
debug, debugging, navigation, searchbar, table

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
» Stats
Members: 158,884
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, karlam963
Powered by vBadvanced CMPS v3.1.0

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