iPhone SDK Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingiPhone SDK Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 22nd, 2010, 06:19 PM
computerfox computerfox is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2010
Posts: 2 computerfox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 6 sec
Reputation Power: 0
Developer new to iPhone

Hello Everyone,

I'm familiar with quite a number of languages, but I just can't seem to get objective-c.

I'm trying to write a basic temp convertor programmer just to understand the basics of the languages, but I keep getting errors and warnings.

The main error I'm getting is " Can't convert to pointer"

here's my .h file:

Code:

//
//  tempConvertViewController.h
//  tempConvert
//
//  Created by Abel Gancsos on 5/22/10.
//  Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface tempConvertViewController : UIViewController {
	
	IBOutlet UITextField *temp;
	IBOutlet UITextField *type;
	IBOutlet UILabel *final;
	
	double tempValue;
	char typeValue;

}

-(IBAction) convert:(id)sender;
@end


and here's the .m file

Code:

//
//  tempConvertViewController.m
//  tempConvert
//
//  Created by Abel Gancsos on 5/22/10.
//  Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import "tempConvertViewController.h"

@implementation tempConvertViewController

-(IBAction)convert:(id)sender{
	
	tempValue=
	if(typeValue=='C'|| typeValue=='c'){
		
		tempValue=(((tempValue/5)*9)+32);
		
		[final setText:[tempValue text]];
	}
	
	
	if(typeValue=='F'||typeValue=='f'){
		
		tempValue=(((tempValue-32)*5)/9);
		
		[final setText:[tempValue text]];
	}

	
	
	
}


/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/


/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/


/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
}


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

@end


Any ideas? I know that if I can understand what's going on, then I can understand the basics of objective-c.

Reply With Quote
  #2  
Old May 22nd, 2010, 06:44 PM
computerfox computerfox is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2010
Posts: 2 computerfox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 6 sec
Reputation Power: 0
Anyone?......

Reply With Quote
  #3  
Old June 13th, 2010, 10:19 AM
iqessar iqessar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2010
Posts: 2 iqessar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 41 sec
Reputation Power: 0
Heres some help

Quote:
Originally Posted by computerfox
Anyone?......



I took a few hours out and did some coding for you. Im a newbie, but I aint giving up.

Most of it is done for you, still some parts left.

Everythings there, appdelegate class, viewcontrolller and nib file. etc


h t t p : / / w w w . m j c a r s p a r e s . c o . u k / p r o j y . z i p


pasted below as well. (I obviously cant paste the NIB file here!)




//
// tempConvertViewController.h
// tempConvert
//
// Created by Qessar on 13/06/2010.
// Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface tempConvertViewController : UIViewController {


IBOutlet UITextField *temp;
IBOutlet UITextField *type;
IBOutlet UILabel *final;

}


@property (nonatomic, retain) IBOutlet UITextField *temp;
@property (nonatomic, retain) IBOutlet UITextField *type;
@property (nonatomic, retain) IBOutlet UILabel *final;


-(IBAction) convert;




@end



//
// tempConvertViewController.m
// tempConvert
//
// Created by Qessar on 13/06/2010.
// Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import "tempConvertViewController.h"

@implementation tempConvertViewController


@synthesize temp;

@synthesize type;

@synthesize final;



-(IBAction)convert{


}




- (BOOL)textFieldShouldReturnUITextField *)textField {

double tempValue = [temp.text doubleValue];

if ([type.text isEqualToString:@"C"] || [type.text isEqualToString:@"c"]) {

tempValue = (((tempValue/5)*9)+32);

}



NSString *result = [NSString stringWithFormat:@"%f", tempValue];

[temp resignFirstResponder];
final.text = result;
[textField resignFirstResponder];
return YES;

}




/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibNameNSString *)nibNameOrNil bundleNSBundle *)nibBundleOrNil {
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
// Custom initialization
}
return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/


/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
}
*/


/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientationUIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}


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

@end

Reply With Quote
  #4  
Old October 8th, 2010, 02:05 AM
winstonterr winstonterr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Posts: 1 winstonterr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 29 sec
Reputation Power: 0
Hi,
I would like to get an iphone, but the new one is very expensive. However, the iphone 3G is cheaper and so i was wondering, are you able to download features such as horizontal texting on to the iphone? Can you give me a site if possible that would let me know this. Thanks in advance!
____________________________
free calls from PC to mobile

Reply With Quote
  #5  
Old October 25th, 2010, 12:13 PM
Veamon's Avatar
Veamon Veamon is offline
Blowing up trees with my mind.
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Feb 2005
Location: Neverland Ranch, minus the touching.
Posts: 3,382 Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)Veamon User rank is General 24th Grade (Above 100000 Reputation Level)  Folding Points: 205630 Folding Title: Super Ultimate Folder - Level 1Folding Points: 205630 Folding Title: Super Ultimate Folder - Level 1Folding Points: 205630 Folding Title: Super Ultimate Folder - Level 1Folding Points: 205630 Folding Title: Super Ultimate Folder - Level 1Folding Points: 205630 Folding Title: Super Ultimate Folder - Level 1Folding Points: 205630 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Weeks 1 Day 2 h 5 m 54 sec
Reputation Power: 2566
I'm guessing you're running it unlocked on tmobile? Otherwise if you're worried about money you can get a 3gs from att for 99.

But yes, the updated os has landscape.

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingiPhone SDK Development > Developer new to iPhone

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap